【问题标题】:How to configure angular-maphilight如何配置角度映射灯
【发布时间】:2017-04-07 12:12:07
【问题描述】:

如果我没记错的话,我正在使用 angular 1.5 并且我正在尝试突出显示图像的区域图。我找到了 angular-maphilight http://abdallamohamed.github.io/Angular-Maphilight/#/,但是在我启动项目的前两个步骤之后,我收到了

 angular.js:68 Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module angular-maphilight due to:
Error: [$injector:nomod] Module 'angular-maphilight' 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-maphilight": "*" 被添加到bower.json 和文件夹 angular-maphilight 到 bower_components

index.module.js:

(function() {
  'use strict';

  angular
    .module('app', [...., 'angular-maphilight']);
})();

bower.json

{
  "name": "mwaApp2",
  "version": "0.0.0",
  "dependencies": {
    ...,
    "jquery": "2.2.x",
    ....
    "angular": "1.5.x",
    "angular-maphilight": "*"
  },
  "devDependencies": { ...

这里是我的 rendition.html

<div class="row">
  <div class="col-sm-12">
    <!--<angular-maphilight id="MapTitle">-->

      <img src="{{ rd.paragraph.field_indesign_rendition[1].url }}" height="{{ rd.obj.elem.pageHeight }}" width="{{ rd.obj.elem.pageWidth }}">

      <map>
        <div ng-repeat="articles in rd.obj.elem.articles">

          <area class="area" ng-repeat="articleMembers in articles.articleMembers" shape="poly" title="{{articleMembers.id}}"
                coords='{{ articleMembers.geometricBounds[1] }}, {{ articleMembers.geometricBounds[0] }},
                        {{ articleMembers.geometricBounds[1] }}, {{ articleMembers.geometricBounds[2] }},
                        {{ articleMembers.geometricBounds[3] }}, {{ articleMembers.geometricBounds[2] }},
                        {{ articleMembers.geometricBounds[3] }}, {{ articleMembers.geometricBounds[0] }}'
          />

        </div>
      </map>
    <!--</angular-maphilight>-->

  </div>
</div>

【问题讨论】:

  • 显示您的配置可能会帮助人们解决您的配置问题...

标签: angularjs debugging maphilight


【解决方案1】:

Angular Maphighlight 的模块名称是 ngMapHilight 而不是 angular-maphighlight

【讨论】:

  • 总是这样吗?我知道我有这种东西,例如 {key:"angular-resource", "module": "ngResource"} 但没有 angular-maphilight 的痕迹
  • 这是一个命名约定。没有严格的规定。取决于回购作者。始终与示例文件进行交叉检查。如果问题得到解决,请接受答案。
  • 是的。差不多。
猜你喜欢
  • 1970-01-01
  • 2020-11-29
  • 2021-10-31
  • 2018-03-07
  • 1970-01-01
  • 2020-02-07
  • 2023-03-14
  • 2021-08-02
  • 2016-03-14
相关资源
最近更新 更多