Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng2-prism doesn't compile anymore: AppViewManager removed from Angular2 rc1 #6

Open
bbottema opened this issue May 21, 2016 · 2 comments

Comments

@bbottema
Copy link

ng2-prism still uses old classes from Angular2 since rc1, causing angular/angular2-seed#79.

@Shoocky
Copy link

Shoocky commented Jun 25, 2016

any workaround or ng2-prism alternative?

@bbottema
Copy link
Author

bbottema commented Jun 27, 2016

@Shoocky I'm requiring the library distribution using webpack manually (instead of importing it from the source files), which I acquired from Prism's download builder. Then using Angular's AfterViewChecked lifecycle event I use the global Prism reference (unfortunately).

In the .ts file where I need it:

declare var Prism:any;

require('./lib/prism.ts');

export class YourApp implements AfterViewChecked {
  ngAfterViewChecked():any {
    return Prism.highlightAll();
  }
}

Then to prevent it from being included in my own bundle:

In external.ts (for any other libraries I need to bootstrap this way):

require('./app/lib/prism.ts');

In webpack.config.js:

  entry: {
    'polyfills': './src/polyfills.ts',
    'vendor': './src/vendor.ts',
    'external': './src/external.ts',
    'app': './src/app.ts'
  }

Also include in the CommonsChunkPlugin entry of webpack.config.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants