0

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!

10
  • which angular version are you using? Commented 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. Commented Jun 15, 2015 at 19:57
  • v1.3.16 downloaded from the official website Commented Jun 15, 2015 at 19:57
  • Where exactly @eat-sleep-code ? Commented Jun 15, 2015 at 19:58
  • @Chirac after the first object inside the logs array Commented Jun 15, 2015 at 19:58

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

4 Comments

Are you sure this is fixing the problem? Testing it in JSFiddle doesn't work.
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.
@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.
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!
1

I am new to angular, but I think you are calling your module right after you create it and you don't need to do that. Remove .queryLogTool that is right before .controller. It should look like:

angular.module("queryLogTool", []).controller("queryLogToolController", function ($scope) {

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.