Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"></script>
  <meta charset="utf-8">
  <title>Validated constants</title>
<script>
  angular.module('MyApp', [])
  .provider('MyAppConstants', function () {
    // default values
    var values = {
      username: 'World'
    };
    return {
      $get: function () {
        return values;
      }
    };
  })
  .run(function ($rootScope, MyAppConstants) {
    $rootScope.username = MyAppConstants.username;
  });
</script>    
</head>
<body ng-app="MyApp">  
  <p>Hello, {{ username }}</p>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
bahmutovpro
0viewers