Skip to content

Instantly share code, notes, and snippets.

@ysyun
Created April 16, 2013 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysyun/5394125 to your computer and use it in GitHub Desktop.
Save ysyun/5394125 to your computer and use it in GitHub Desktop.
AngularJS <ng-view>와 $routeProvider 사용 예
/*
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