0

I am using angular.js for my project and adding script in a partial or view but it is not working. I want to include script for single partial only so i don't want to add that script on the index page. Is there any way to include single script for a partial or view in angular.js

user2218817
  • 1
  • 1
  • 1

1 Answers1

0

This seems pretty similar to this question AngularJS: How to run additional code after AngularJS has rendered a template?

Accordng to this, your best bet might be to use $evalAsync()

http://docs.angularjs.org/api/ng.$rootScope.Scope#$evalAsync

Although that kind of depends on what the code you're trying to run is (post it pls?). My advice is try to "angularize" whatever you're trying to do after the template has loaded so that you can include it in your controller. If that doesn't work, then look for other solutions.

Community
  • 1
  • 1
NicolasMoise
  • 7,261
  • 10
  • 44
  • 65