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.4.0/angular.min.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body ng-app="firstApp">
  
  <div ng-controller="mainController as main">
    <p>{{1 + 64}}</p>
    <p>{{main.msg}}</p>
    <p>{{main.computedValue()}}</p>
</body>
</html>
 
var app = angular.module("firstApp", []);
app.controller("mainController", function() {
  var vm = this;
  this.msg = "Hello from NG controller";
  this.computedValue = function() {
    
    return 'Fancy function call here.';
  }
});
Output

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

Dismiss x
public
Bin info
anonymouspro
0viewers