I have this code, from a tutorial I've followed online; unfortunately it's not working, and I can't find why because I'm mentioning the script, the app, the controller etc.. Any help would be appreciated!
-
which angular version are you using?Jean Cedron– Jean Cedron2015-06-15 19:57:02 +00:00Commented Jun 15, 2015 at 19:57
-
Not sure if it's just a cut and paste error, but I see an extra comma in your angular script.eat-sleep-code– eat-sleep-code2015-06-15 19:57:42 +00:00Commented Jun 15, 2015 at 19:57
-
v1.3.16 downloaded from the official websiteChirac– Chirac2015-06-15 19:57:51 +00:00Commented Jun 15, 2015 at 19:57
-
Where exactly @eat-sleep-code ?Chirac– Chirac2015-06-15 19:58:22 +00:00Commented Jun 15, 2015 at 19:58
-
@Chirac after the first object inside the logs arrayJean Cedron– Jean Cedron2015-06-15 19:58:57 +00:00Commented Jun 15, 2015 at 19:58
|
Show 5 more comments
2 Answers
Change your .js to this:
var app = angular.module("queryLogTool", []);
app.controller("queryLogToolController", function ($scope) {
$scope.logs = [
{
'Issuer': 'AngularJSTest',
'Issue': 'AngularJS not working',
'Priority': 'High',
'Status': 'Open',
'DateOfIssue': '19/01/2015',
'DateResolved': '19/04/2015'
}
];
});
Look at this plnkr: Plnkr
4 Comments
Chirac
Are you sure this is fixing the problem? Testing it in JSFiddle doesn't work.
Chirac
Indeed it's working in PInkr, but not in JSFiddle or in my Visual Studio. Not sure if I'm doing something wrong in this.
Jean Cedron
@Chirac have you check your libraries? I'm using 1.3.16 as you said. Open your application, press F12 in Chrome and check your console log.
Chirac
Thanks for the console log advice! Helped me discover that the angular was not defined because you need to include angular first and put the script right below the code! Thanks!