2 angular.service('myApplication', function($route){
4 $route.when("", {template:'/cb/welcome.html', controller:WelcomeCntl});
5 $route.when("/settings", {template:'/cb/settings.html', controller:SettingsCntl});
7 // initialize the model to something useful
10 contacts:[{type:'email', url:'anonymous@example.com'}]
12 }, {$inject:['$route'], $creation:'eager'});
14 function WelcomeCntl(){}
15 WelcomeCntl.prototype = {
17 alert("Hello " + this.person.name);
21 function SettingsCntl(){
24 SettingsCntl.prototype = {
26 this.form = angular.copy(this.person);
30 angular.copy(this.form, this.person);
31 window.location.hash = "#";
35 <h1>Your App Chrome</h1>
36 [ <a href="#">Welcome</a> | <a href="#/settings">Settings</a> ]
38 <span style="background-color: blue; color: white; padding: 3px;">
39 Partial: {{$route.current.template}}
41 <div style="border: 1px solid blue; margin: 0;">
42 <ng:include src="$route.current.template" scope="$route.current.scope"></ng:include>
44 <small>Your app footer </small>