Cordova学习笔记 ng-include标签的使用
<!doctypehtml><htmllang="en"><head><metacharset="UTF-8"><title>test</title><scriptsrc="js/angular.js"></script><scripttype="application/javascript">(function(angular){'usestrict';angular.module('myApp',[]).controller('firstController',functionfirstController($scope){$scope.page="test.html";$scope.page2="page2.html";});})(window.angular);//主模块window.onload=function(){varmyAppdiv=document.getElementById('myApp22');angular.bootstrap(myAppdiv,['myApp'])//动态的绑定主mudule的html作用范围}</script></head><body><divid="myApp22"><divng-controller="firstController"><divng-include="page"><!--把一个页面包涵进来作为这个div中的子标签--></div><divng-include="page2"></div><!--也可以把同域下的script中定义的模板引进来--><divng-includesrc="page2"></div></div><scripttype="text/ng-template"id="page2.html">hehehehehe</script></div></body></html>
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。