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
//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); | |
}); |
No comments:
Post a Comment