Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngcart directive #90

Open
kostalihas opened this issue May 10, 2017 · 2 comments
Open

ngcart directive #90

kostalihas opened this issue May 10, 2017 · 2 comments

Comments

@kostalihas
Copy link

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.

@GaboDot
Copy link

GaboDot commented Jul 12, 2017

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!

@kostalihas
Copy link
Author

kostalihas commented Jul 18, 2017

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants