var app = angular.module("app",[]); app.directive("location", function(){ return { restrict: "E", link: function(scope, element, attribute){ scope.lon = attribute.lon; scope.lat = attribute.lat; }, template: '<div>Lon: {{lon}}, Lat: {{lat}}</div>' } });
<div ng-app="app"> <location lon="23.52" lat="42.12"></location> </div>