我有以下代码;
var app =
angular.
module("myApp",[]).
config(function($routeProvider, $locationProvider) {
$routeProvider.when('/someplace', {
templateUrl: 'sometemplate.html',
controller: SomeControl
});
// configure html5 to get links working on jsfiddle
$locationProvider.html5Mode(true);
});
app.controller('SomeControl', ...);
我收到以下错误
Uncaught ReferenceError: SomeControl is not defined from myApp
问题只是我不能使用 app.controller('SomeControl', ...) 语法吗?使用 $routeProvider 时?是唯一有效的语法:
function SomeControl(...)