我使用AngularJS的js文件出现问题:“未捕获的错误:[$ injector:modulerr]”

时间:2019-04-04 13:49:37

标签: javascript jquery html angularjs

我正在编写AngularJS,该人使用的版本是1.0.8,而我使用的是1.7.8 angular并且想要更新它。有人可以帮我吗?

文件:index.html

SELECT 
    f.Name
    ,f.Info
    ,LinkedInProfile1 = MAX(CASE WHEN pf.ProfileId  = 1 THEN CONCAT(lip.Name,'(',pf.Id,')') END)
    ,LinkedInProfile2 = MAX(CASE WHEN pf.ProfileId  = 2 THEN CONCAT(lip.Name,'(',pf.Id,')') END)
    ,lip.Client
    ,ConAccepted = MAX(CASE WHEN a.Name = 'ConAccepted' THEN fa.Created END)
    ,Message = MAX(CASE WHEN a.Name = 'Message ' THEN fa.Created END)
    ,LikesContent = MAX(CASE WHEN a.Name = 'LikesContent ' THEN fa.Created END)
    ,JoinsGroup = MAX(CASE WHEN a.Name = 'JoinsGroup ' THEN fa.Created END)
    ,M1 = MAX(CASE WHEN da.Name = 'M1' THEN das.Created END)
    ,M2 = MAX(CASE WHEN da.Name = 'M2 ' THEN das.Created END)
    ,M3 = MAX(CASE WHEN da.Name = 'M3 ' THEN das.Created END)
    ,M4 = MAX(CASE WHEN da.Name = 'M4 ' THEN das.Created END)
FROM fan f
JOIN dbo.ProfileFan pf
    ON pf.FanId = f.FanId
JOIN dbo.LinkedInProfile lip
    ON lip.Id = pf.ProfileId
JOIN dbo.FanActivities fa
    ON fa.ProfileFanId = pf.Id
JOIN Activities a
    ON a.Id = fa.ActivityId
JOIN dbo.DeliveryActions das
    ON das.ProfileFanId = pf.Id
JOIN dbo.DeliveryAction da
    ON da.Id = das.ActivityId
GROUP BY f.Name, f.info, lip.Client

文件:listar.html

<!doctype html>
<html ng-app="pessoas">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Pessoas</title>
</head>

<body>

<div ng-controller="CtrlPessoas">
    <h1>Sistemas de gerenciamento de pessoas</h1>

    <ng-view></ng-view>

</div>

</body>

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.8/angular.min.js"></script>
<script src="pessoas.js"></script>

</html>

文件:pessoas.js

<h2>Listagem de Pessoas</h2>

<ul>
    <li ng-repeat="pessoa in pessoas">
        {{pessoa.nome}}, {{pessoa.cidade}}
    </li>
</ul>

1 个答案:

答案 0 :(得分:1)

您缺少ngRoute模块:

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.8/angular-route.min.js"></script>  


angular.module('pessoas', ['ngRoute'])