0

I want to override the templateurl of the component.

Lets say I have below component.

angular.
module('myApp').
component('greetUser', {
template: usertemplate.html,
controller: function GreetUserController() {
this.user = 'world';
}
});

I am want to override this component so that whenever they access geet-user my custom template.html. It tired by re declaring the same but it is throwing an error saying two selector for geet-user. Any suggestions?

Thanks,In Advance. Sree.

sree
  • 868
  • 2
  • 12
  • 35
  • You can either go with creating a new component itself with your new template. Is there any limitation ? – Rajat Aug 10 '20 at 02:23
  • Yes.The component is in 3rd party library. – sree Aug 10 '20 at 02:51
  • May be http://thaiat.github.io/blog/2014/03/10/extending-an-existing-directive-in-angularjs/ can help.. And may I know the 3rd party library name ? – Rajat Aug 10 '20 at 03:05
  • It is related hybris commerce smartedit library – sree Aug 10 '20 at 03:13
  • @RajatMishra Thanks. That document is mainly about the controller.Mine is to override the template. – sree Aug 10 '20 at 03:45

0 Answers0