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.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body ng-app="app">
  <div ng-controller="mainControl">
    <a href="" ng-click="callFacebook()">click</a>
      </div>
</body>
</html>
 
var app = angular.module('app', [])
.service('facebook' , ['$window' , function(){
return function(){
    alert('hello!')
}
}])
.controller('mainControl' , ['$scope' , '$http' , '$log', 'facebook' , function($scope,$http,$log,facebook){
    $scope.$log = $log;
    $scope.message = 'hello world!';
  
    $scope.callFacebook = function(){
        facebook();
    }
}])
Output 300px

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

Dismiss x
public
Bin info
zieemerpro
0viewers