angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Custom Handlerbar susbtitution support

Open arpit-agarwal opened this issue 10 years ago • 2 comments

Please provide us with the following information:

  1. OS Mac OSX ( El Capitan)
  1. Versions. angular-cli: 1.0.0-beta.9
  2. Repro steps. Support for custom handlerbar template.
  • Update index.html to support external lib by handlerbar expension
    {{#each scripts.polyfills}}
    <script src="{{.}}"></script>
    {{/each}}
    {{#each scripts.libs}}
    <script src="{{.}}"></script>
    {{/each}}
  • In angular-cli-build.js if i add custom option it will not passed on to handlebar
  var app = new Angular2App(defaults, {
    vendorNpmFiles: external.node_modules.files,
    polyfills: external.polyfills,
    libs: external.libs,
    //destDir: dest,
  });
  1. None
  2. Mention any other details that might be useful.

I have resolve this by extending Angular2App and override _getIndexTree

class MyAngular2App extends Angular2App
{
  constructor(project, inputNode, options) {
    super(project, inputNode, options);
  }
  _getIndexTree()
  {
    let replacer = super._getIndexTree();
    let scripts = replacer._context.scripts;
    scripts.libs = vendor.libs;
    scripts.json = vendor.json;
    replacer._context.css =
      {
          vendors: vendor.css
      }
    return replacer;
  }
}

Ideally , there should be option in angular-cli.json or angular-cli-build.js to provide additional replacer for updating tempalte. CSS, JSON, external lib may be used commonly so support for them should be theer atleast


Thanks! We'll be in touch soon.

arpit-agarwal avatar Jul 26 '16 07:07 arpit-agarwal

Closed as this issue was made obsolete by https://github.com/angular/angular-cli/pull/1455.

filipesilva avatar Jul 27 '16 02:07 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.