Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Angular js中如何使用路由(控制器和方法名称)_Javascript_Angularjs_Asp.net Mvc - Fatal编程技术网

Javascript 在Angular js中如何使用路由(控制器和方法名称)

Javascript 在Angular js中如何使用路由(控制器和方法名称),javascript,angularjs,asp.net-mvc,Javascript,Angularjs,Asp.net Mvc,在js函数中使用此选项,但此选项不起作用。您需要导入“路由”模块,以便在Angular中使用路由。导入后,您需要使用数组指定对象中的路径和组件。 例如: 干杯 给我一个解决方案,你可以很容易地找到如何做轮班。这是给我的。他要的是angularjs。是的,我告诉过angular only@SaimaHaji这很有效。var url='';url=“…控制器/方法”;window.location.href=url window.location.href ='@Url.Action("Redire

在js函数中使用此选项,但此选项不起作用。

您需要导入“路由”模块,以便在Angular中使用路由。导入后,您需要使用数组指定对象中的路径和组件。 例如:


干杯

给我一个解决方案,你可以很容易地找到如何做轮班。这是给我的。他要的是angularjs。是的,我告诉过angular only@SaimaHaji
这很有效。var url='';url=“…控制器/方法”;window.location.href=url
window.location.href ='@Url.Action("Redirect", "Dashboard")'
const routes: Routes = [{
    path:'',
    pathMatch:'full',
    component:WeatherViewComponent
}];