Created
September 23, 2015 23:55
-
-
Save vaneves/71028c0e3ad62bc47c29 to your computer and use it in GitHub Desktop.
Blog Ninja - App
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
'use strict'; | |
var app = angular.module('ninja', ['ngRoute', 'ngResource', 'ngAnimate', 'ninja.services', 'ninja.controllers', 'toastr']); | |
app.constant('API', 'api.php'); | |
app.config(function ($routeProvider) { | |
$routeProvider.when('/', { | |
controller: 'BlogListCtrl', | |
templateUrl: 'view/blog/list.html' | |
}); | |
$routeProvider.when('/detail/:id', { | |
controller: 'BlogDetailCtrl', | |
templateUrl: 'view/blog/detail.html' | |
}); | |
$routeProvider.when('/list', { | |
controller: 'PostListCtrl', | |
templateUrl: 'view/post/list.html' | |
}); | |
$routeProvider.when('/add', { | |
controller: 'PostCreateCtrl', | |
templateUrl: 'view/post/add.html' | |
}); | |
$routeProvider.when('/edit/:id', { | |
controller: 'PostEditCtrl', | |
templateUrl: 'view/post/add.html' | |
}); | |
$routeProvider.otherwise({ | |
redirectTo: '/' | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment