在AngularJS局部模板使用第三方的Javascript? [英] Using 3rd Party Javascript in AngularJS Partials?

查看:133
本文介绍了在AngularJS局部模板使用第三方的Javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我利用的AngularJS局部模板来创建仪表板。有一个列表查看,当你点击一个项目,它切换到一个项目,详细的部分。

I've making use of AngularJS Partial templates to create a dashboard. There is a listing view and when you click on an item, it switches to an Items-Detail partial.

在项目细节部分,我想通过展示一些RGraph图表。但是,对于我的生活,我无法弄清楚如何做到这一点。

Inside the Items detail partial, I'd like to show some charts via RGraph. However, for the life of me, I can't figure out how to do this.

我似乎无法从部分HTML中调用JavaScript。因此,我认为我需要做的是在控制器,或者创建一个指令?

I can't seem to invoke javascript from inside the partial html. So I think I need to do it in the controller, or maybe create a directive?

我是pretty新AngularJS所以我的理解还是很不成熟,并且有可能被误导。

I'm pretty new to AngularJS so my understanding is still very rudimentary and likely misguided.

推荐答案

AngularJS(jqlite)不支持< script>标签里面的谐音。

AngularJS ("jqlite") doesn't support <script> tags inside partials.

包含jQuery的页面上,但是,它应该工作。需要注意的是jQuery的必须包含AngularJS之前。

Include jQuery on your page, however, and it should work. Note that jQuery must be included before AngularJS.

又见<一个href=\"http://stackoverflow.com/questions/12197880/angularjs-how-to-make-angular-load-script-inside-ng-include\">AngularJS:如何使内部角度负载脚本NG-包括哪些内容?

这篇关于在AngularJS局部模板使用第三方的Javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆