Open kostalihas opened 7 years ago
Hi! I also created a custom directive as follows:
.directive('ngcartTotal', [function(){
return {
restrict : 'E',
controller : 'CartController',
scope: {},
templateUrl: function(element, attrs) {
if ( typeof attrs.templateUrl == 'undefined' ) {
return 'assets/js/template_cart/ngCart/cartTotal.html';
} else {
return attrs.templateUrl;
}
},
link:function(scope, element, attrs){
}
};
}])
And then just call it using <ngcart-total></ngcart-total>
Hope this helps!
yes it's a good idea ,another way I found it is to create a template.html and call it inside any directive using the attribute temlpate-url like bellow:
<ngcart-addtocart template-url="/template/ngCart/cartpdj.html"></ngcart-addtocart>
I create a new directive and passe the same content of ngcartCart directive and just change the template url because I need another form html for my cart, I dont know why I get nothing displayed.