Skip to content
Browse files

Update seed app

  • Loading branch information...
1 parent 93599ab commit 5da17aa54c27618433eeb3c64eefc5e69cc5d407 @vojtajina vojtajina committed Mar 14, 2012
Showing with 32 additions and 41 deletions.
  1. +7 −7 app/index-async.html
  2. +5 −5 app/index.html
  3. +6 −13 app/js/app.js
  4. +10 −0 app/js/directives.js
  5. +1 −1 app/js/filters.js
  6. +1 −1 app/js/services.js
  7. +0 −11 app/js/widgets.js
  8. +0 −1 config/jsTestDriver.conf
  9. +2 −2 test/e2e/scenarios.js
View
14 app/index-async.html
@@ -3,19 +3,19 @@
<head>
<meta charset="utf-8">
<style>
- [ng\\:cloak] {
+ [ng-cloak] {
display: none;
}
</style>
<script>
// include angular loader, which allows the files to load in any order
/*
- AngularJS v0.10.6-5cdfe45a
+ AngularJS v1.0.0rc1
(c) 2010-2012 AngularJS http://angularjs.org
License: MIT
*/
- '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",
- "register"),config:h,run:function(a){g.push(a);return this}};e&&h(e);return f})}})})(window);
+ '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"),
+ 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);
// include a third-party async loader library
/*!
@@ -34,13 +34,13 @@
'js/services.js',
'js/controllers.js',
'js/filters.js',
- 'js/widgets.js'
+ 'js/directives.js'
], function() {
// when all is done, execute bootstrap angular application
angular.bootstrap(document, ['myApp']);
});
</script>
- <title>my angular app</title>
+ <title>My AngularJS App</title>
<link rel="stylesheet" href="css/app.css"/>
</head>
<body>
@@ -49,7 +49,7 @@
<li><a href="#/view2">view2</a></li>
</ul>
- <ng:view></ng:view>
+ <ng-view></ng-view>
<div>Angular seed app: v<span app-version></span></div>
View
10 app/index.html
@@ -1,8 +1,8 @@
<!doctype html>
-<html xmlns:ng="http://angularjs.org/" ng:app="myApp">
+<html ng-app="myApp">
<head>
<meta charset="utf-8">
- <title>my angular app</title>
+ <title>My AngularJS App</title>
<link rel="stylesheet" href="css/app.css"/>
</head>
<body>
@@ -11,15 +11,15 @@
<li><a href="#/view2">view2</a></li>
</ul>
- <ng:view></ng:view>
+ <ng-view></ng-view>
<div>Angular seed app: v<span app-version></span></div>
- <script src="lib/angular/angular.js" ng:autobind></script>
+ <script src="lib/angular/angular.js"></script>
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
<script src="js/filters.js"></script>
- <script src="js/widgets.js"></script>
+ <script src="js/directives.js"></script>
</body>
</html>
View
19 app/js/app.js
@@ -1,17 +1,10 @@
'use strict';
-/* http://docs.angularjs.org/#!angular.service */
-// Declare app level module which depends on filters, and services
-angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.widgets']).
- run(['$route', '$window', '$rootScope', function($route, $window, $rootScope) {
-
- $route.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
- $route.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
- $route.otherwise({redirectTo: '/view1'});
- var self = this;
-
- $rootScope.$on('$afterRouteChange', function(){
- $window.scrollTo(0,0);
- });
+// Declare app level module which depends on filters, and services
+angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']).
+ config(['$routeProvider', function($routeProvider) {
+ $routeProvider.when('/view1', {template: 'partials/partial1.html', controller: MyCtrl1});
+ $routeProvider.when('/view2', {template: 'partials/partial2.html', controller: MyCtrl2});
+ $routeProvider.otherwise({redirectTo: '/view1'});
}]);
View
10 app/js/directives.js
@@ -0,0 +1,10 @@
+'use strict';
+/* http://docs-next.angularjs.org/api/angular.module.ng.$compileProvider.directive */
+
+
+angular.module('myApp.directives', []).
+ directive('appVersion', ['version', function(version) {
+ return function(scope, elm, attrs) {
+ elm.text(version);
+ };
+ }]);
View
2 app/js/filters.js
@@ -1,5 +1,5 @@
'use strict';
-/* http://docs.angularjs.org/#!angular.filter */
+/* http://docs-next.angularjs.org/api/angular.module.ng.$filter */
angular.module('myApp.filters', []).
filter('interpolate', ['version', function(version) {
View
2 app/js/services.js
@@ -1,5 +1,5 @@
'use strict';
-/* http://docs.angularjs.org/#!angular.service */
+
// Demonstrate how to register services
// In this case it is a simple constant service.
View
11 app/js/widgets.js
@@ -1,11 +0,0 @@
-'use strict';
-/* http://docs.angularjs.org/#!angular.widget */
-
-angular.module('myApp.widgets', [], function() {
- // temporary hack until we have proper directive injection.
- angular.directive('app-version', function() {
- return ['version', '$element', function(version, element) {
- element.text(version);
- }];
- });
-});
View
1 config/jsTestDriver.conf
@@ -9,4 +9,3 @@ load:
- test/unit/*.js
exclude:
-
View
4 test/e2e/scenarios.js
@@ -18,7 +18,7 @@ describe('my app', function() {
it('should render view1 when user navigates to /view1', function() {
- expect(element('ng\\:view p:first').text()).
+ expect(element('ng-view p:first').text()).
toMatch(/partial for view 1/);
});
@@ -33,7 +33,7 @@ describe('my app', function() {
it('should render view1 when user navigates to /view2', function() {
- expect(element('ng\\:view p:first').text()).
+ expect(element('ng-view p:first').text()).
toMatch(/partial for view 2/);
});

0 comments on commit 5da17aa

Please sign in to comment.
Something went wrong with that request. Please try again.