首页
IT
登录
6mi
u
盘
搜
搜 索
IT
ui-router使用路由调用绝对路径template
ui-router使用路由调用绝对路径template
xiaoxiao
2021-12-14
23
(
function
()
{
'use strict'
;
angular
.
module
(
'cms'
).
config
(
route
);
route
.
$inject
=
[
'$routeProvider'
];
function
route
(
$routeProvider
)
{
$routeProvider
.
when
(
'/:section'
,
{
templateUrl
:
buildPath
})
.
when
(
'/:section/:page'
,
{
templateUrl
:
buildPath
})
.
when
(
'/:section/:page/:task'
,
{
templateUrl
:
buildPath
});
}
function
buildPath
(
path
)
{
var
layout
=
'layout'
;
angular
.
forEach
(
path
,
function
(
value
)
{
value
=
value
.
charAt
(
0
).
toUpperCase
()
+
value
.
substring
(
1
);
layout
+=
value
;
});
layout
+=
'.tpl'
;
return
'client/app/layouts/'
+
layout
;
}
})();
转载请注明原文地址: https://ju.6miu.com/read-963290.html
专利
最新回复
(
0
)