wetfMapping.directive('wetfMapping', function($timeout) {
return {
restrict: 'E',
require: 'ngModel',
scope: {},
template: '<svg class="svgContainer"></svg>',
link: function (scope, element, attrs, ngModel) {
ngModel.$render = function() {
scope.cell = ngModel.$viewValue;
if (angular.isDefined(scope.cell)) {
drawMapping(...);
}
};
}
};
});drawMapping function, the Snap object is instantiated on the SVG element and then the actual set up of the SVG happens according to the ngModel state. Tell me if you need more info.