Skip to content Skip to sidebar Skip to footer

Angularjs Directive With $http Requests (inprog Error)

I've searched and tried many things for this, and I think maybe Im just doing it wrong. I have a single page app that has very similar DOM pieces, differentiated only by the data t

Solution 1:

If you are using angular 1.2.x or above your directive will not work because it is using an isolate scope. Isolate scope means that any variable you assign to the scope can only be used from within the scope's internal template (meaning the template defined in the directive using the template: attribute.

Since your directive does not have a template, you should not use isolate scope. Instead of doing:

scope: {}

You should do:

scope: true

This will make the directive create a scope but not isolate it. This will make your directive's scope available to the outer template (i.e. your ng-repeat).

Keep this in mind, if you don't have a template defined in your directive you should hardly ever use an isolate scope.

Post a Comment for "Angularjs Directive With $http Requests (inprog Error)"