Building the admin section for CRUD operations

We will now look to build the admin section of our CMS using Angular JS. The AngularJS app will talk to the backend ExpressJS scripts that we just wrote in the preceding section.

Creating the routes for the admin section

Ideally, we would like our admin section to be called from within the admin URL, so let's go ahead and add the routes for the admin section of the AngularJS app.

Add the following routes to the angcms/public/js/app.js file:

config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider.when('/admin/login', { templateUrl: 'partials/admin/login.html', controller: 'AdminLoginCtrl' }); $routeProvider.when('/admin/pages', { templateUrl: 'partials/admin/pages.html', ...

Get AngularJS Web Application Development Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.