我已经开始使用“ngNewRouter
”。在我的应用程序中,使用javascript我需要在多个组件之间切换。我已经使用$location.path(path);
,但它不一致。以下是详细信息。
//定义路线
$router.config([
{path: "/", redirectTo: "userauthentication"}, // The default URL is redirected to userauthentication component.
{path: "/userauthentication", component: "userauthentication"},
{path: "/adminview", component: "adminview"},
{path: "/clubonboarding/:clubid", component: "clubonboarding"},
{path: "/membermanagement", component: "membermanagement"}
]);
$locationProvider.html5Mode(true);
守则,正在努力:
$location.path("adminview");
守则,不工作:
$location.path("userauthentication");
它作为它工作在几个地方让我感到吃惊和不适用于其他人。我在这里错过了什么。
请指教。
“不工作”是什么意思?你有错误吗?你有错误的页面?触发此代码的事件是否永远不会触发?目前尚不清楚问题出在哪里。 – Claies
是的,事件被触发,但视图不会改变。 – joy