Javascript没有';在离子模板中不工作?
我的爱奥尼亚项目中有不同的html模板文件。那些是链接的东西Javascript没有';在离子模板中不工作?,javascript,angularjs,ionic-framework,ionic-view,Javascript,Angularjs,Ionic Framework,Ionic View,我的爱奥尼亚项目中有不同的html模板文件。那些是链接的东西 $stateProvider .state('home', { url: '/', templateUrl: 'home.html', controller: 'HomeController' }) Javascript在html文件(index.html)中工作,该文件包括home.html,但在home.html <ion-view title="Home"> <ion-content>
$stateProvider
.state('home', {
url: '/',
templateUrl: 'home.html',
controller: 'HomeController'
})
Javascript在html文件(index.html
)中工作,该文件包括home.html
,但在home.html
<ion-view title="Home">
<ion-content>
<script type="text/javascript">console.log('abc')</script>
</ion-content>
</ion-view>
console.log('abc')
如何解决这个问题?AngularJS不支持这个。在页面上包括jQuery,然后是angularjs,它应该可以工作。请参见
是ng视图更改的一部分,无需重新加载页面
您必须在main
index.html
页面中添加脚本src的唯一方法是直接询问您想要找到更好的方式来组织代码的函数不确定您要问什么。请发布更多代码。在爱奥尼亚视图文件中使用javascript代码是完全错误的。但是,如果您想在ionic view文件中使用put js代码作为第一行或最后一行,并且应该可以使用。@Rahul,您能解释一下为什么在ionic view文件中使用javascript代码是完全错误的吗?