Created
April 11, 2015 01:56
-
-
Save okunokentaro/42b74134921a846ee153 to your computer and use it in GitHub Desktop.
NewRouterでこれできんの?ってやつ
This file contains 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
angular.module('app', ['ngNewRouter']); | |
function RootController() { | |
// noop | |
} | |
RootController.$routeConfig = [ | |
{ | |
path: '/', | |
redirectTo: '/home' | |
}, { | |
path: '/home', | |
component: 'home' | |
} | |
]; | |
function ddo(){ | |
return { | |
restrict: 'A', | |
controller: RootController, | |
controllerAs: 'Root' | |
}; | |
} | |
angular.module('app').directive('AppController', ddo); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>router</title> | |
</head> | |
<body ng-app="app" app-controller> | |
<div ng-viewport></div> | |
<script src="angular.js"></script> | |
<script src="router.es5.js"></script> | |
<script src="app.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment