私はモジュール化されたAngularJS1.5アプリケーションを持っていますが、これはモジュール化されたフロントエンドに使用されていて、 Kubernetesで。angularjs内の位置パスに従ってhrefまたはsrefを使用してください
これまで分割されて以来、すべてのアプリケーションがNPMにパックされた共通モジュールとコアモジュールを共有しており、Jenkinsパイプラインの各モジュールに追加されています。
すべてのアプリケーションは、そのナビゲーションペインを含む同じUXスタイルのフロントエンドを共有します。モジュール間で変更するには、ナビゲーションペインに移動して目的のリンクをクリックするだけです。
私がやりたいことは、ユーザーがすでにfooモジュールで言うようになっていて、親FOOモジュールのperformとsrefナビゲーション内にあるFOO1に移動したいのですが、それがFOOモジュールにあり、 BARモジュールに移動してhrefを実行します。
より良いこれを説明するに、これは私の現在のシナリオです:
www.domain.com/foo
ナビゲーションバー
|->FOO
|-->FOO1
|-->FOO2
|-->FOO3
|->BAR
|-->BAR1
|-->BAR2
|-->BAR3
これは私が私のナビゲーションを持っているコードです。 provider.js
(function (angular) {
'use strict';
angular.module('xxxx.core.layout')
.provider('xxxx.core.layout.NavigationProvider', NavigationProvider);
NavigationProvider.$inject = [
'xxxx.core.states.StatesConstant',
'xxxx.core.auth.PermissionConstant',
'$windowProvider',
'$location',
'xxxx.core.auth.PermissionTypeConstant',
'xxxx.core.features.FeaturesConstant'
];
function NavigationProvider(StatesConstant, PermissionConstant, $windowProvider, $location, PermissionTypeConstant, FeaturesConstant) {
this.$get = Navigation;
function Navigation() {
var $window = $windowProvider.$get();
return [
text: 'FOO',
permission: [
PermissionConstant.XXXX,
PermissionConstant.XXXX_EDIT
].toString(),
permissionType: PermissionTypeConstant.AT_LEAST_ONE,
children: [
{
text: 'User Management',
//sref: StatesConstant.USER_MANAGEMENT_LIST,
href: $window.location.protocol + '//' + $window.location.hostname + '/foo/um/list',
permission: PermissionConstant.XXXX
},
{
text: 'Active Features',
//sref: StatesConstant.TOGGLE_ADMINISTRATOR,
href: $window.location.protocol + '//' + $window.location.hostname + '/foo/toggle',
permission: PermissionConstant.XXXX
},
{
text: 'Customer List',
//sref: StatesConstant.XXXX_LIST,
href: $window.location.protocol + '//' + $window.location.hostname + '/foo/customer-list',
permission: PermissionConstant.XXXX_EDIT
}
]
私が実装したいのは、t彼:
let $location = $location.path();
if($location = "/foo"){
sref: StatesConstant.USER_MANAGEMENT_LIST,
}else{
href: $window.location.protocol + '//' + $window.location.hostname + '/foo/um/list',
}
ご協力いただければ幸いです。
乾杯!