Created
May 29, 2015 14:33
-
-
Save stevenh77/9432d9e9f6599f770f56 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//define module | |
var app = angular.module('app', []); | |
//define constant | |
app.constant("mynumberValue", 200); | |
//define value | |
app.value("numberValue", 100); | |
app.value("objectValue", { name: "dotnet-tricks.com", totalUsers: 120000 }); | |
// only difference is that values cannot be used in module config function | |
app.config(function (mynumberValue) { //here value objects can't be injected | |
console.log("Before:" + mynumberValue); | |
mynumberValue = "New Angular Constant Service"; | |
console.log("After:" + mynumberValue); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment