I tried to use
<script type="text/javascript" ng-src="{{referenceDir.creative}}"></script>
to include a script in a ABSOLUTE file location that I stored in $scope.referenceDir.creative
(which value is something like "/lib/creative.js
")
I did a console.log
in create.js
, but I see no console.log been triggered where this piece of script is loaded in a template for a route ( I use ui-router btw).
I wonder am I using the wrong tag to reference a java-script file? These file suppose to only run on that specific route, because they are jquery files that associated with specific doms, which I do not want to include in other routes, that's why I include the script with ng-src INSIDE a template HTML.
Any hint I will be grateful. Thank you!