<html>
<head>
<title>test</title>
<meta charset="utf-8" />
<script src="scripts/angular.js"></script>
<script src="scripts/app.js"></script>
</head>
<body>
<div ng-app="musicApp">
<div ng-controller="ArtistController">
{{artist}}
<button ng-click="pumpkins()">Pumpkins</button>
<button ng-click="rise()">Rise</button>
</div>
</div>
</body>
</html>
angular.module('musicApp',[])
.controller('ArtistController', ['$scope', ArtistController]);
function ArtistController($scope) {
$scope.artist = 'Foo';
$scope.pumpkins = function () {
$scope.artist = "pumpkins";
}
$scope.rise = function () {
$scope.artist = "Rise";
}
}
No comments:
Post a Comment