angular / material-start

Starter Repository for AngularJS Material
https://angularjs-material-start.web.app
MIT License
2.21k stars 1.21k forks source link

how to add ui-router for es6 version? #180

Closed bochuxt closed 5 years ago

bochuxt commented 7 years ago

Hello, I would like to use ui-router for es6, anyone can help me?

bochuxt commented 7 years ago

"angular-ui-router": "npm:angular-ui-router@0.4.2", "angular-ui-grid": "npm:angular-ui-grid@^4.0.6",

.controller('AppController', AppController) // .controller('HomeController', HomeController) .config(function ($stateProvider, $urlRouterProvider) {

    $stateProvider
        .state('users', {
            url: '/users',
            templateUrl: './src/users/usersView.html',
            // controller: 'AppController',
            // controllerAs: 'app'
        });

    $stateProvider
        .state('home', {
            url: '/home',
            templateUrl: './src/corp/home.html',

        });
    $stateProvider
        .state('profile', {
            url: '/profile',
            templateUrl: './src/profile/profile.html',
            controller:'ProfileCtrl',
            controllerAs: 'profileCtl',
            params: {
                // srouce: "login",// from purchase or login
                totalAmount:"",
                cart:'',        //from purchase
                products:'',     //from login
                user:''

            },

        });
Splaktar commented 5 years ago

You don't mention what issue you were running into. Have you tried looking at the ui-router Tutorial?