我有以下代码;
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', ...);
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
Uncaught ReferenceError: SomeControl is not defined from myApp
Run Code Online (Sandbox Code Playgroud)
问题只是我不能使用app.controller('SomeControl',...)语法?什么时候使用$ routeProvider?是唯一有效的语法:
function SomeControl(...)
Run Code Online (Sandbox Code Playgroud)