Created
October 17, 2013 00:54
-
-
Save HAKASHUN/7017578 to your computer and use it in GitHub Desktop.
AngularJSでmoduleを定義して使ってみる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--ng-appにmyAppをセット--> | |
<html ng-app='myApp'> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Text</title> | |
</head> | |
<body ng-controller="TextController"> | |
<p>{{someText.message}}</p> | |
<script src="../bower_components/angular/angular.js"></script> | |
<script> | |
//myAppModuleという名前のモジュールを作成 | |
var myAppModule = angular.module('myApp', []); | |
//myAppModuleのコントローラを作成 | |
myAppModule.controller( | |
'TextController', | |
function($scope){ | |
var someText = {}; | |
someText.message = 'You have started your journey.'; | |
$scope.someText = someText; | |
} | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment