Search Posts

Author: said

AngularJS: Display SVG from JSON

I want to display my svg file from json using Rest Api, I have not managed to display it. json file: { “id”: “sample string 1”, “svg”: “/PlanSvg/Planwidget”, “name”: “plan” } Controller.js: $scope.LoadLeaf = function (Id_Leaf) { REST.DoGET(PATH_LEAF, “/” + Id_Leaf).success(function (data) { $scope.Leaf = data; }).error(function () { }); } <div ng-controller=”MapLiveWidget”> <div >{{Leaf.id}}</div> <div>{{Leaf.name}}</div> <div><img ng-src=”Leaf.svg'”</div> </div> Source: AngularJS