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
Post a Comment