<HTMLNg-app>//Global references corresponding to Phonelistctrl templates <Head> <Scriptsrc= "Js/angular.js"></Script> <Scriptsrc= "Js/test.js"></Script></Head><BodyNg-controller= "Phonelistctrl"> <ul> <Ling-repeat= "Pho in Phones">{{Pho.name}}<P>{{Pho.snippet}}</P> </Li> </ul>
Scope of the div inside the MyApp<DivNg-app= "MyApp"Ng-controller= "MyTest"> <ul> <Ling-repeat= "ph in Phone">{{Ph.name}}<P>{{Ph.snippet}}</P> </Li> </ul> </Div> </Body></HTML>
JS Code
functionPhonelistctrl ($scope) {$scope. Phones= [ { "Name": "Nexus S", "Snippet": "Fast just got faster with Nexus S." }, { "Name": "Motorola xoom™with Wi-Fi", "Snippet": "The next, next Generation tablet." }, { "Name": "MOTOROLA xoom™", "Snippet": "The next, next Generation tablet." } ];} Self-Declaration template common external usevarApp = Angular.module (' MyApp '), []); App.controller (' MyTest ',function($scope) {$scope. Phone= [ { "Name": "Nexus S", "Snippet": "Fast just got faster with Nexus S." }, { "Name": "Motorola xoom™with Wi-Fi", "Snippet": "The next, next Generation tablet." }, { "Name": "MOTOROLA xoom™", "Snippet": "The next, next Generation tablet." } ];});
Http://www.widuu.com/archives/04/1035.html
http://www.ituring.com.cn/article/15762
Not yet Epiphany