Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Ryan Hellerud
Ryan Hellerud
3,635 Points

using angular with ngDialog for pop up .

Guys I'm new to angular and trying to figure out how to implement a module called ngDialog so that I can have a pop up appear with angular data ect. Right now, I have my controller:

var oflApp = angular.module('oflApp', ['ngDialog']);
oflApp.controller('oflClassCtrl', function ($scope,ngDialog) {
$scope.classes = [
{"class": "ENGLISH I: INTRO TO LITERATURE AND COMPOSITION Sem 2", "href": "../courses/english.php#p1"}, ect
$scope.clickToOpen = function(index){
       $scope.selectedClass= $scope.classes[index];
       ngDialog.open({template: '../inc/popUp.html'});

and html:

<table ng-controller="oflClassCtrl">
<tr ng-repeat = "selectedClass in classes | filter:searchTxt">
        <td><a  ng-click="clickToOpen($index)">{{selectedClass.class}}</a></td>

of course i've added the scripts underneath my angular scripts but is there anything else i need for this to work? I'm not sure what's going on but the pop will not show up on click so im sure something is wrong. What am I doing wrong? Thanks friends.

here is the link to the docs: