O'Reilly logo

AngularJS Directives Cookbook by Fernando Monteiro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building accordion tab directives

Another way to deal with Bootstrap UI directives is to override the default HTML template. This can be done in two ways: inside the HTML file or externally.

As you may have observed, Angular Bootstrap has two files: one called ui-bootstrap-tpls.js and the other just ui-bootstrap.js.

The difference is simple, the tpls suffix at the end of the filename indicates that the file has all the Bootstrap templates inside, and the others don't.

If you try to use the ui-bootstrap.js file you will receive an error because the compiled code doesn't find the templates, and you must provide templates for all the widgets.

Perhaps this is not a good idea when you want to override one or two components, so consider using a custom build. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required