次のコードがあります。AngularJS Uncaught ReferenceError:コントローラがモジュールから定義されていません
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(...)
の重複:http://stackoverflow.com/questions/11211999/using-angular-controllers-created-with-angular-module-controller –
ありがとう@KarlZilles - 私は検索が、逃しましたそれです。 –