用 yo 搭建 angular 版本较高 出现 URL乱码 !#

在app.js里加入以下:

angular
    .module('babylonjsApp', [
        'ngAnimate',
        'ngCookies',
        'ngResource',
        'ngRoute',
        'ngSanitize',
        'ngTouch'
    ])
    .config(function($routeProvider, $locationProvider) {
        $locationProvider.hashPrefix("");
        $routeProvider
            .when('/', {
                templateUrl: 'views/main.html',
                controller: 'MainCtrl',
                controllerAs: 'main'
            })
            .otherwise({
                redirectTo: '/'
            });
    });

 

posted @ 2017-03-28 16:41  wupanpan  阅读(488)  评论(0编辑  收藏  举报