Michal_Szulc Michal_Szulc - 3 months ago 92
AngularJS Question

Create new page in angularjs blur-admin

According to the tutorial I've added new page and module, but it doesn't seem to work (neither it's shown in a sidebar, nor I can get it via direct url). What am I missing?

Answer

Note the newPage that you have added has module name as BlurAdmin.pages.myNewPage and state as myNewPage as given in the code

(function () {
    'use strict';

    angular.module('BlurAdmin.pages.myNewPage', [])
    .config(routeConfig);
    /** @ngInject */
    function routeConfig($stateProvider) {
    $stateProvider
        .state('myNewPage', {
            url: '/myNewPage',
            templateUrl: 'app/pages/myNewPage/my-new-page.html',
            title: 'My New Page',
            sidebarMeta: {
                order: 800,
            },
        });
    }

})();

Now goto src/app/pages you will find pages.module.js. You should add mentioned new module to list:

angular.module('BlurAdmin.pages', [
    'ui.router',
    'BlurAdmin.pages.dashboard',
    'BlurAdmin.pages.ui',
    'BlurAdmin.pages.components',
    'BlurAdmin.pages.form',
    'BlurAdmin.pages.tables',
    'BlurAdmin.pages.charts',
    'BlurAdmin.pages.maps',
    'BlurAdmin.pages.profile',
    'BlurAdmin.pages.myNewPage'
])

And you are done.