Skip to content

Commit 5da17aa

Browse files
committed
Update seed app
1 parent 93599ab commit 5da17aa

File tree

9 files changed

+32
-41
lines changed

9 files changed

+32
-41
lines changed

app/index-async.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<head>
44
<meta charset="utf-8">
55
<style>
6-
[ng\\:cloak] {
6+
[ng-cloak] {
77
display: none;
88
}
99
</style>
1010
<script>
1111
// include angular loader, which allows the files to load in any order
1212
/*
13-
AngularJS v0.10.6-5cdfe45a
13+
AngularJS v1.0.0rc1
1414
(c) 2010-2012 AngularJS http://angularjs.org
1515
License: MIT
1616
*/
17-
'use strict';(function(i){function d(a,b,c){return a[b]||(a[b]=c())}return d(d(i,"angular",Object),"module",function(){var a={};return function(b,c,e){c&&a.hasOwnProperty(b)&&(a[b]=null);return d(a,b,function(){function a(b,c){return function(){d.push([b,c,arguments]);return f}}if(!c)throw Error("No module: "+b);var d=[],g=[],h=a("$injector","invoke"),f={_invokeQueue:d,_runBlocks:g,requires:c,name:b,service:a("$provide","service"),factory:a("$provide","factory"),value:a("$provide","value"),filter:a("$filterProvider",
18-
"register"),config:h,run:function(a){g.push(a);return this}};e&&h(e);return f})}})})(window);
17+
'use strict';(function(i){function d(c,a,e){return c[a]||(c[a]=e())}return d(d(i,"angular",Object),"module",function(){var c={};return function(a,e,f){e&&c.hasOwnProperty(a)&&(c[a]=null);return d(c,a,function(){function b(a,b,d){return function(){c[d||"push"]([a,b,arguments]);return g}}if(!e)throw Error("No module: "+a);var c=[],d=[],h=b("$injector","invoke"),g={_invokeQueue:c,_runBlocks:d,requires:e,name:a,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),
18+
value:b("$provide","value"),constant:b("$provide","constant","unshift"),filter:b("$filterProvider","register"),directive:b("$compileProvider","directive"),config:h,run:function(a){d.push(a);return this}};f&&h(f);return g})}})})(window);
1919

2020
// include a third-party async loader library
2121
/*!
@@ -34,13 +34,13 @@
3434
'js/services.js',
3535
'js/controllers.js',
3636
'js/filters.js',
37-
'js/widgets.js'
37+
'js/directives.js'
3838
], function() {
3939
// when all is done, execute bootstrap angular application
4040
angular.bootstrap(document, ['myApp']);
4141
});
4242
</script>
43-
<title>my angular app</title>
43+
<title>My AngularJS App</title>
4444
<link rel="stylesheet" href="css/app.css"/>
4545
</head>
4646
<body>
@@ -49,7 +49,7 @@
4949
<li><a href="#/view2">view2</a></li>
5050
</ul>
5151

52-
<ng:view></ng:view>
52+
<ng-view></ng-view>
5353

5454
<div>Angular seed app: v<span app-version></span></div>
5555

app/index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!doctype html>
2-
<html xmlns:ng="http://angularjs.org/" ng:app="myApp">
2+
<html ng-app="myApp">
33
<head>
44
<meta charset="utf-8">
5-
<title>my angular app</title>
5+
<title>My AngularJS App</title>
66
<link rel="stylesheet" href="css/app.css"/>
77
</head>
88
<body>
@@ -11,15 +11,15 @@
1111
<li><a href="#/view2">view2</a></li>
1212
</ul>
1313

14-
<ng:view></ng:view>
14+
<ng-view></ng-view>
1515

1616
<div>Angular seed app: v<span app-version></span></div>
1717

18-
<script src="lib/angular/angular.js" ng:autobind></script>
18+
<script src="lib/angular/angular.js"></script>
1919
<script src="js/app.js"></script>
2020
<script src="js/services.js"></script>
2121
<script src="js/controllers.js"></script>
2222
<script src="js/filters.js"></script>
23-
<script src="js/widgets.js"></script>
23+
<script src="js/directives.js"></script>
2424
</body>
2525
</html>

app/js/app.js

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
11
'use strict';
2-
/* http://docs.angularjs.org/#!angular.service */
32

4-
// Declare app level module which depends on filters, and services
5-
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.widgets']).
6-
run(['$route', '$window', '$rootScope', function($route, $window, $rootScope) {
7-
8-
$route.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
9-
$route.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
10-
$route.otherwise({redirectTo: '/view1'});
113

12-
var self = this;
13-
14-
$rootScope.$on('$afterRouteChange', function(){
15-
$window.scrollTo(0,0);
16-
});
4+
// Declare app level module which depends on filters, and services
5+
angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).
6+
config(['$routeProvider', function($routeProvider) {
7+
$routeProvider.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
8+
$routeProvider.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
9+
$routeProvider.otherwise({redirectTo: '/view1'});
1710
}]);

app/js/directives.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict';
2+
/* http://docs-next.angularjs.org/api/angular.module.ng.$compileProvider.directive */
3+
4+
5+
angular.module('myApp.directives', []).
6+
directive('appVersion', ['version', function(version) {
7+
return function(scope, elm, attrs) {
8+
elm.text(version);
9+
};
10+
}]);

app/js/filters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
/* http://docs.angularjs.org/#!angular.filter */
2+
/* http://docs-next.angularjs.org/api/angular.module.ng.$filter */
33

44
angular.module('myApp.filters', []).
55
filter('interpolate', ['version', function(version) {

app/js/services.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
/* http://docs.angularjs.org/#!angular.service */
2+
33

44
// Demonstrate how to register services
55
// In this case it is a simple constant service.

app/js/widgets.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

config/jsTestDriver.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ load:
99
- test/unit/*.js
1010

1111
exclude:
12-

test/e2e/scenarios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('my app', function() {
1818

1919

2020
it('should render view1 when user navigates to /view1', function() {
21-
expect(element('ng\\:view p:first').text()).
21+
expect(element('ng-view p:first').text()).
2222
toMatch(/partial for view 1/);
2323
});
2424

@@ -33,7 +33,7 @@ describe('my app', function() {
3333

3434

3535
it('should render view1 when user navigates to /view2', function() {
36-
expect(element('ng\\:view p:first').text()).
36+
expect(element('ng-view p:first').text()).
3737
toMatch(/partial for view 2/);
3838
});
3939

0 commit comments

Comments
 (0)