routeProvider在有哈希时更改

时间:2017-02-25 01:02:31

标签: angularjs route-provider

过去一小时我一直在谷歌上搜索,但找不到答案。 我希望在URL中传递参数时更改模板。

我尝试使用hash来通过调用控制器中的'use strict'; angular.module('myApp.projects', ['ngRoute']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/projects', { templateUrl: 'modules/projects/projects.html', controller: 'projectsCtrl' }); }]) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/projects:project', { // $routeProvider.when('/projects#project', { // Tried this and it didn't work as well templateUrl: 'modules/projects/single-project.html', controller: 'projectsCtrl' }); }]) .controller('projectsCtrl',['$scope','portfolioService','$location', function($scope,portfolioService,$location){ $scope.portfolio = portfolioService.portfolio; console.info('$location.hash',$location.hash()); // $scope.currentProject = $location; }]) 来检索它,但我无法弄清楚如何让routeProvider检测到它,这是我的代码:

String res = DContext.Database.SqlQuery<String>("SELECT dbo.fn_getVehicleIDByIMIE(@p0)", IMEI).FirstOrDefault();
return Convert.ToInt32(res);

0 个答案:

没有答案