Issue
I have the following jsfiddle that I am trying to get working:
http://jsfiddle.net/edwardtanguay/pz2L6etv/2/
var myApp = angular.module('myApp',[]);
function mainController($scope) {
$scope.numbers = ['one','two','three'];
}
myApp.directive('uiCalendar', function () {
return {
restrict: 'A',
scope: {
message: "@theMessage",
color: "@"
},
link: function (scope, element, attrs) {
scope.color = scope.color === undefined ? 'black' : scope.color;
$(element).append('<p style="color:'+scope.color+'">added this2: ' + scope.message + ' (' + scope.color + ')</p>');
}
};
});
It works locally but not at jsfiddle. But I don't see any error messages being shown in jsfiddle to help me debug it there, and my Firebug shows only jsfiddle-related information in the Console.
How can I get jsfiddle to show me errors so I can debug my AngularJS code?
Solution
Actually jsfiddle is outputting the errors right to the console, as expected. The problem is that one of your external resources is breaking execution before the angular code is run. Check it out, I forked your fiddle and removed that resource, and now the errors are output to the console just fine :)
function mainController($scope) {
$scope.numbers = ['one','two','three'];
console.log('hooray errors!');
}
Answered By - wesww
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.