Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/412.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法为视图实例化ngRoute_Javascript_Angularjs_Ng View - Fatal编程技术网

Javascript 无法为视图实例化ngRoute

Javascript 无法为视图实例化ngRoute,javascript,angularjs,ng-view,Javascript,Angularjs,Ng View,我在JS文件中使用以下代码: var mainAngular = angular.module('baniyaApp', ['ngRoute','ui.bootstrap']); ////======================== CONFIG ================================= mainAngular.config(function($routeProvider, $locationProvider) { alert('ng route'); $rout

我在JS文件中使用以下代码:

var mainAngular = angular.module('baniyaApp', ['ngRoute','ui.bootstrap']);

////======================== CONFIG =================================
mainAngular.config(function($routeProvider, $locationProvider) {
alert('ng route');
$routeProvider
        .when('/', {
            templateUrl: "HomeLandPage.html"
        });
});
////=================================================================
“HomeLandPage.html”存在于同一位置,因此路径没有问题。包含ng view的主页。我已经注意到使用link中的angular.js文件

我在控制台上得到以下错误。请确认JavaScript文件是否正确

Uncaught Error: [$injector:modulerr] Failed to instantiate module baniyaApp due to:
Error: [$injector:modulerr] Failed to instantiate module ngRoute due to:
Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.

在应用程序目录中包含
angular.js
之后,您需要包含
angular.js
,而html

include是否
ngRoute
存在于应用程序目录中?