Created
May 3, 2014 11:10
-
-
Save bahattincinic/878305b73f618dbabec7 to your computer and use it in GitHub Desktop.
Constans in Angular Js
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
var myApp = angular.module('myApp', []); | |
// settings | |
myApp.constant('settings', { | |
apiEndpoint: '/api/v1', | |
node: 'http://domain.com:8888', | |
}); | |
// controller | |
myApp.controller('MyCtrl', ['$scope', 'settings', function($scope, settings){ | |
$scope.api = settings.apiEndpoint; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment