单击链接时,Angularjs ui-view路由无法正常工作[关闭]

问题描述 投票:0回答:1

我在这里使用Angular ui-routing功能当我点击舔url在url栏中扩展像this

ANgularCtrl是

    var app = angular.module('MyApp', ['ui.router'])
app.config(['$qProvider', '$stateProvider', function ($qProvider, $stateProvider) {
    $qProvider.errorOnUnhandledRejections(false);
    var Custstate = {
        name: 'Customer',
        url: 'Views/Customer/Customer.html',
    }
    $stateProvider.state(Custstate);
}])

Ui-view是

 <a ui-sref="Customer" ui-sref-active="active">Customer</a>
    <ui-view></ui-view>
angularjs angular-ui-router
1个回答
0
投票

在配置寄存器状态像这样。

var routerApp = angular.module('MyApp', ['ui.router']);

routerApp.config(function($stateProvider, $urlRouterProvider) {
    $stateProvider
    .state('Customer', {
        url: '/Customer',
        templateUrl: 'Views/Customer/Customer.html'
    });

});

有关更多详细信息,请参阅https://scotch.io/tutorials/angular-routing-using-ui-router

© www.soinside.com 2019 - 2024. All rights reserved.