Skip to content

Commit 8e15ebc

Browse files
feat(chapter-1): rewrites
1 parent 4c7eb65 commit 8e15ebc

File tree

31 files changed

+108
-137
lines changed

31 files changed

+108
-137
lines changed

1820EN_01_Code/08 - different directive names/index.html

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

1820EN_01_Code/09 - ngShowHide and ngSwitch/index.html

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

1820EN_01_Code/10 - text box with a limit/app.js

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

1820EN_01_Code/10 - text box with a limit/index.html

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

1820EN_01_Code/11 - ngSwitch verbose/app.js

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

1820EN_01_Code/11 - ngSwitch verbose/index.html

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

1820EN_01_Code/12 - ngRepeat needs a container/app.js

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

1820EN_01_Code/12 - ngRepeat needs a container/index.html

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
angular.module('app', ['engines'])
2+
3+
.controller('AppCtrl', function ($scope, car) {
4+
car.start();
5+
})
6+
7+
.factory('car', function ($log, dieselEngine) {
8+
return {
9+
start: function() {
10+
$log.info('Starting ' + dieselEngine.type);
11+
}
12+
};
13+
});
14+
15+
angular.module('engines', [])
16+
.factory('dieselEngine', function () {
17+
return {
18+
type: 'diesel'
19+
};
20+
});
21+
22+
23+
24+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">
4+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script>
5+
<script src="app.js"></script>
6+
</head>
7+
8+
<body ng-app="app" ng-controller="AppCtrl">
9+
</body>
10+
</html>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
angular.module('app', ['engines', 'cars'])
2+
.controller('AppCtrl', function ($scope, car) {
3+
car.start();
4+
});
5+
6+
angular.module('cars', [])
7+
.factory('car', function ($log, dieselEngine) {
8+
return {
9+
start: function() {
10+
$log.info('Starting ' + dieselEngine.type);
11+
}
12+
};
13+
});
14+
15+
angular.module('engines', [])
16+
.factory('dieselEngine', function () {
17+
return {
18+
type: 'diesel'
19+
};
20+
});
21+
22+
23+
24+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">
4+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script>
5+
<script src="app.js"></script>
6+
</head>
7+
8+
<body ng-app="app" ng-controller="AppCtrl">
9+
</body>
10+
</html>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
angular.module('app', ['engines', 'cars'])
2+
.controller('AppCtrl', function ($scope, car) {
3+
car.start();
4+
});
5+
6+
angular.module('cars', [])
7+
.factory('car', function ($log, dieselEngine) {
8+
return {
9+
start: function() {
10+
$log.info('Starting ' + dieselEngine.type);
11+
}
12+
};
13+
})
14+
15+
.factory('dieselEngine', function () {
16+
return {
17+
type: 'custom diesel'
18+
};
19+
});
20+
21+
angular.module('engines', [])
22+
.factory('dieselEngine', function () {
23+
return {
24+
type: 'diesel'
25+
};
26+
});
27+
28+
29+
30+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<html>
2+
<head>
3+
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet">
4+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script>
5+
<script src="app.js"></script>
6+
</head>
7+
8+
<body ng-app="app" ng-controller="AppCtrl">
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)