我正在使用角度js应用程序中的指令。这是我的指令的一个片段:
(function() {
var gMaps = function($timeout, $q, GeoCoder, mockdataService) {
return {
restrict: 'EA',
template: '<div class="gmaps"></div>',
replace: true,
link: function postLink(scope, iElement, iAttrs) {
..
在我的index.html中,我有指令:
<gMaps center="map.center" zoom="map.zoom"></gMaps>
当我在控制台中调试时,它甚至没有点击gmaps.js文件?控制台中没有可见错误。可能有什么不对? 这是plunkr的网址:http://plnkr.co/edit/fEsaE9XpgmKFqO194X4G?p=preview
答案 0 :(得分:2)
变化:
<gMaps center="map.center" zoom="map.zoom"></gMaps>
要:
<g-maps center="map.center" zoom="map.zoom"></g-maps>