Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html ng-app="app">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-controller="c">
    
    Hello {{ name }}
</body>
</html>
 
angular.module("app", [])
.service("initData", function() {
    
    var _data = {};
    
    this.data = function() {
        return _data;
    };
    
    this.login = function(name) {
        _data.name = name;
    };
    
})
.run(function(initData) {
    
    // some function with login data
    // doLogin();
    
    // stores
    initData.login("Hickmann");
    
})
.controller("c", function($scope, initData) {
    
    $scope.name = initData.data().name;
    
});
Output 300px

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

Dismiss x
public
Bin info
joaozitopolopro
0viewers