angular.js nested directive scope scope attribute <p>I would like to to a "map" tag witch should contains "marker" tags.</p> <p>my problem is that I would like to set the "marker" attributes using variables from the "map" parent scope.</p> <p>if I do this:</p> <pre><code> &lt;map center="{{userPosition}}"&gt; &lt;marker lat="13.555232324" lng="43.555232324" text="Text1" on-click="callback('id_0')" &gt;&lt;/marker&gt; &lt;/map&gt; </code></pre> <p>my code works, but I would like to do something like:</p> <pre><code> &lt;map center="{{userPosition}}"&gt; &lt;marker lat="{{nearRooms['id_0'].lat}}" lng="{{nearRooms['id_0'].lng}}" text="Text1" on-click="callback('id_0')" &gt;&lt;/marker&gt; &lt;/map&gt; </code></pre> <p>right now I can just read "lat" as a string.</p> <p>my map directive:</p> <pre><code>ngBMap.directive('map', [ function ($compile){ return { restrict: 'E', controller: ['$scope', function($scope) { this.markers = []; $scope.markers = []; this.mapHtmlEl = null this.map = null; this.exeFunc = function(func, context, args){ $scope.$parent[func].apply(context, args) } this.initializeMarkers = function(){ for (var i=0; i&lt;this.markers.length; i++) { var marker = this.markers[i]; this.map.entities.push(marker); } } this.initializeMap = function(scope, elem, attrs){ var map_canvas = document.createElement('div') var _thisCtrl = this; .... this.mapHtmlEl = map_canvas; } this.setCenter = function(position){ var position = eval(position) var _position = new Microsoft.Maps.Location(position[0], position[1]) if(this.map) this.map.setView({center : _position}); } }], scope: { 'center': '@', }, link: function(scope, element, attrs, ctrl) { scope.$watch('center', function(center) { console.log('center: '+center) if(center){ ctrl.setCenter(center) } }, false); ctrl.initializeMap(scope, element, attrs) element.html(ctrl.mapHtmlEl) } } </code></pre> <p>}]);</p> <p>my marker directive:</p> <pre><code>ngBMap.directive('marker', [ function ($compile){ return { restrict: 'E', require: '^map', link: function(scope, element, attrs, mapController) { console.log('marker init') var getMarker = function() { var lat = attrs.lat ..... var marker = _marker; return marker; }//end getMarker var marker = getMarker(); mapController.markers.push(marker); } }}]); </code></pre>