omer727
omer727

Reputation: 7737

Angular Directive with ng-include template

I've defined the following directive I've defined the following dirctive in my js file:

.directive('tabContent',function(){    
                return {
                restrict: 'E',
                template:'<div ng-if="view==\'card" ng-include="card.html"></div>'
            }
        })

and than used it in my html:<tabContent></tabContent> but all I got is a remark <!--div--><!--ng-if--><!--ng-include--> What am I missing?

Upvotes: 1

Views: 144

Answers (1)

David L
David L

Reputation: 33883

You are missing a closing escaped ' on card in your string and ng-include requires single quotes as well, since it will parse your url as an expression.

template:'<div ng-if="view==\'card\'" ng-include="\'card.html\'"></div>'

Upvotes: 2

Related Questions