JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="app" >
<div ng-if="true">
<p>Now you can see-me because the condition in ng-if is true. Change it to false and update the code!</p>
</div>
</div>
JavaScript
angular.module('app',[])
.directive('ngIf', function() {
return {
link: function(scope, element, attrs) {
if(scope.$eval(attrs.ngIf)) {
// remove '<div ng-if...></div>'
element.replaceWith(element.children())
} else {
element.replaceWith(' ')
}
}
}
});