Showing posts from September, 2013

AngularJS how to cast html element

this will usually be used by SharePoint Developers since in angular u have the ngBindHtml.

but in SP u usually get a fields as a complete html like LinkFields or ImageFields and u don't want to put then under a container, like the bindHtml force u, but to put it strait in a template.

so I did this:
<ling-repeat="item in">

and my castMe directive:
Module.directive("castMe", function ($compile, $timeout) {
   return {
     link: function (scope, element, attrs) {
var newElem = angular.element(scope.item[attrs.castMe]);
if (element.attr('class') !== '')
         newElem.attr('class', element.attr('class'));

the point is t…