Skip to content

Instantly share code, notes, and snippets.

@vaneves
Created September 23, 2015 23:55
Show Gist options
  • Save vaneves/71028c0e3ad62bc47c29 to your computer and use it in GitHub Desktop.
Save vaneves/71028c0e3ad62bc47c29 to your computer and use it in GitHub Desktop.
Blog Ninja - App
'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