如果我没有弄错,我正在使用角度1.5,我正在尝试突出显示图像的区域地图。我发现了角度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
,并且将文件夹角度变换为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>
答案 0 :(得分:0)
Angular Maphighlight的模块名称为 ngMapHilight
而不是angular-maphighlight