Reputation: 85
How do I debug an AngularJS binding like {{expression}} without any browser addon? I can't use any browser dev tools add-on except Firebug. So, I want to check if the binding expression really has some value from my controller. How do I check this?
(function() {
var app= angular.module("myApp");
var appCtrl = function($scope,$rootScope,$window,$miscService)
{
$scope.myUrl = "http://www.google.com";
}
In the template
<a href="{{myUrl}}" target="_blank">Google</a>
my question is, is it possible to debug my AngularJS expression's value within the HTML?
Upvotes: 3
Views: 2052
Reputation: 3195
You can print your value in the page with
<pre>{{value | json}}</pre>
"json" here is used as Filter and inside AngularJS.
You can read this : https://stackoverflow.com/a/27424876/861206
You can also add a breaking point inside your source code, so next time the value will be evaluated your code will stop and you can see the value associated directly inside the dev tools.
For this open dev tools : Go into "Source" tab. Use Ctrl + O or Cmd + O to choose the file you want to debug, click on the left side of the line where you want your code to stop. So in the next execution the code will stop and you can mouse hover it to see the value associated to it.
Upvotes: 3
Reputation: 36
just print in html <pre>{{myurl}}</pre>
, or try to inspect the code and add breakpoints to the source archive, so the local debuggers stops in the code
i eddited the fiddle it now works, the angular embed was not correct because it has to load using https
Upvotes: 0