-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jonas Bandi
committed
Aug 26, 2014
1 parent
11367c9
commit d410c89
Showing
67 changed files
with
25,158 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
05-Angular/00-Concepts/09-CustomServices/03-ServiceService/css/app.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { | ||
display: none !important; | ||
} |
16 changes: 16 additions & 0 deletions
16
05-Angular/00-Concepts/09-CustomServices/03-ServiceService/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Simple Angular Example</title> | ||
|
||
<link rel="stylesheet" href="css/app.css"/> | ||
|
||
</head> | ||
<body> | ||
<div ng-app="myApp" ng-controller="FirstCtrl" ng-cloak> | ||
{{property}} | ||
</div> | ||
<script src="lib/angular.min.js"></script> | ||
<script src="js/app.js"></script> | ||
</body> | ||
</html> |
21 changes: 21 additions & 0 deletions
21
05-Angular/00-Concepts/09-CustomServices/03-ServiceService/js/app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
var myApp = angular.module('myApp',[]); | ||
|
||
var Calculator = function(){ | ||
// This is a constructor function. | ||
this.add = function(val1, val2) { | ||
|
||
return val1 + val2; | ||
}; | ||
} | ||
|
||
myApp.controller('FirstCtrl', ['Calculator', '$scope', function(calculator, $scope) { | ||
|
||
var v1 = 41; | ||
var v2 = 2; | ||
|
||
$scope.property = calculator.add(v1, v2); | ||
}]); | ||
|
||
myApp.service('Calculator', Calculator); | ||
|
||
|
210 changes: 210 additions & 0 deletions
210
05-Angular/00-Concepts/09-CustomServices/03-ServiceService/lib/angular.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
05-Angular/00-Concepts/09-CustomServices/04-ServiceProvider/css/app.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { | ||
display: none !important; | ||
} |
14 changes: 14 additions & 0 deletions
14
05-Angular/00-Concepts/09-CustomServices/04-ServiceProvider/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Simple Angular Example</title> | ||
|
||
<link rel="stylesheet" href="css/app.css"/> | ||
|
||
</head> | ||
<body ng-app="myApp" ng-controller="FirstCtrl" ng-cloak> | ||
{{property}} | ||
<script src="lib/angular.js"></script> | ||
<script src="js/app.js"></script> | ||
</body> | ||
</html> |
24 changes: 24 additions & 0 deletions
24
05-Angular/00-Concepts/09-CustomServices/04-ServiceProvider/js/app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var myApp = angular.module('myApp',[]); | ||
|
||
myApp.controller('FirstCtrl', ['MyService', '$scope', function(MyService, $scope) { | ||
$scope.property = MyService.theNumber; | ||
}]); | ||
|
||
myApp.provider('MyService', function() { | ||
|
||
var myNumber = 42; | ||
|
||
this.setTheNumber = function(n){ | ||
myNumber = n; | ||
}; | ||
|
||
this.$get = function(){ | ||
return { | ||
theNumber: myNumber | ||
} | ||
} | ||
}); | ||
|
||
myApp.config(['MyServiceProvider', function(myServiceProvider){ | ||
myServiceProvider.setTheNumber(43); | ||
}]); |
Oops, something went wrong.