我用一个配置路由:为什么我的路由不能在Angular JS中使用URL?
.config(['$routeProvider',
function($routeProvider) {
$routeProvider
.when('/appointments', {
controller: 'AppointmentController'
})
}])
和控制器:
.controller('AppointmentController', ['$scope', '$http', '$sce', function ($scope, $http, $sce) {
alert('Test')
}]);
链接看起来像为:http://blogapp.com/appointments
所以,我没有网页上的错误,但alert()
不当我输入URL时工作
尝试使用'http://blogapp.com/appointments '(最后加上“s”) –
对不起,有一个错字。我有's'的网址 – Faud
不能,因为我在PHP /约会页面 – Faud