【发布时间】:2015-06-17 01:08:17
【问题描述】:
我目前有一个使用 Angular 和 UI-Router 的单页 Web 应用程序。我的大部分 javascript 文件都加载到我的 index.html 页面上,并且这些文件在整个应用程序中都能完美运行。
问题:我的状态需要在调用状态时运行 javascript 代码。 (当 ui-router 将此状态的特定 templateURL 中的 html 注入 ui-view 时,我需要运行注入的 html 中的 javascript)。我整天都在搜索并尝试了各种解决方案,但没有任何效果。
是否有添加此功能的最佳做法?谢谢。
【问题讨论】:
标签: javascript angularjs angularjs-directive angular-ui-router