jvandemo / generator-angularjs-library

A generator for Yeoman to generate the boilerplate for creating an AngularJS library
117 stars 33 forks source link

Adding directive templates #37

Closed ErikAugust closed 8 years ago

ErikAugust commented 8 years ago

Is there a recommended directory for adding directive HTML templates? Thank you!

jvandemo commented 8 years ago

@ErikAugust — Great question!

The 2 most common ways would be to:

  1. Inline the templates in your directives using the template property (see AngularJS docs for exact syntax).
  2. If inlining is not an option, you can put your templates in a directory outside of the src directory and use a plugin like gulp-html2js to generate Angular code that primes the Angular template cache with your template. UI-Bootstrap uses this approach.

Does that answer your question? Thanks!

ErikAugust commented 8 years ago

@jvandemo - Makes sense, thanks for the help!

jvandemo commented 8 years ago

@ErikAugust — Welcome Erik, let us know how it went. Thanks!