javascript - ui bootstrap multiple decorators -


used this link update accordion template. need replace ui bootstrap template carousel. there way can chain decorator functions or should done way? also, if need have various versions of carousel? then?

what have right isn't working:

.config(['$provide', decorate])  function decorate($provide) {   $provide.decorator('accordiongroupdirective', function($delegate) {     var directive = $delegate[0];      directive.templateurl = '/modules/projects/views/admin/templates/accordian.html';      return $delegate;   })   .decorator('carousel', function($delegate) {     var directive = $delegate[0];      directive.templateurl = '/modules/projects/views/admin/templates/carousel.html';      return $delegate;   })  } 

whenever wanted decorate of existing component configuration phase of angular, need append component type name, here going decorate directive, need provider name decorator carouseldirective instead of carousel.

code

.decorator('carouseldirective', function($delegate) {     var directive = $delegate[0];      directive.templateurl = '/modules/projects/views/admin/templates/carousel.html';      return $delegate; }) 

Comments

Popular posts from this blog

Hard vs. Soft Water: What's The Difference?

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

The Ten Most Livable Cities In The World