Created
April 16, 2013 07:38
-
-
Save ysyun/5394125 to your computer and use it in GitHub Desktop.
AngularJS <ng-view>와 $routeProvider 사용 예
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
/* | |
ng-view는 routing 되는 페이지를 바꾸어주는 역할을 한다 | |
<div ng-app="app"> | |
<ng-view></ng-view> | |
</div> | |
*/ | |
var app = angular.module("app", []); | |
app.config(function($routeProvider) { | |
$routeProvider.when('/', | |
{ | |
templateUrl: "app.html", | |
controller: "AppCtrl" | |
} | |
) | |
}) | |
app.controller("AppCtrl", function($scope) { | |
$scope.model = { | |
message: "hi dowon" | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment