Currently, I am working on x-cart and as you guys know x-cart is working on smarty template engine. Now my client wants angularjs in x-cart. Have tried so many things but unable to implement it. Have surfed on google but I also didn't get anyway. Can you guys please suggest me something?
I have to serve question.
Please help me in it.
Thank you, guys.
okay, i got an answer. You can not implement angularjs directly as you are implementing in other websites. so here are the answers of your questions.
Is implementing angular js in x-cart is a good idea?
: it depends on what you actually want to do with it? as you wants angularjs to load page faster, first you may check and try this article. to increase performance . if your demands can be completed from here. you don't need angularjs.
Is it possible?
: Yes, it is possible. but you can't complete entire angularjs circle like a request to ng-route and get data back.
If it is possible then how can we implement it?
: all you have to do is include angular's js file and then create one script and get data in angular scope which are coming from php.
for example: there is a product list page, data of products will come as products variable. so create a script in products_t page and get product data in angular scope. give ng-app in HTML from home.tpl file. here i am taking ProductsController.
angular.module('myApp', []).controller('ProductsController', ['$scope', function($scope){ $scope.products = {$products};
}]);
Now define productlist main div as Products controller and process further angularjs operations.
Does it affect other functionality of x-cart?
: If you will follow this structure, it will not affect any x-cart module. just define all values properly.Suggestion: still if your demands are fulfilling from above link. don't try to implement angularjs.