Skip to content

Instantly share code, notes, and snippets.

@renatocantarino
Created June 3, 2014 23:25
Show Gist options
  • Save renatocantarino/15f4771241bb9e62d82d to your computer and use it in GitHub Desktop.
Save renatocantarino/15f4771241bb9e62d82d to your computer and use it in GitHub Desktop.
Constant
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<script type="text/javascript">
app = angular.module("app", []);
app.controller('MainCtrl', function($scope, conf) {
$scope.conf = conf;
});
app.constant('conf', {
Nome: 'Renato',
SobreNome: "Cantarino"
});
</script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body ng-controller="MainCtrl">
Nome: {{conf.Nome}}
<br />
SobreNome: {{conf.SobreNome}}
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment