These are chat archives for AngularClass/angular2-webpack-starter

Jun 2015
Lee Gathercole
Jun 18 2015 07:33

Hi, loving the example, had a question about image loading. I like the idea of using the url loader in webpack to embed base64 encoded images into my bundle. What I can't figure out is how the hell to reference them in my template

var x= document.createElement('img');
x.src = require('./image.jpeg');
Embeds the image beautifully. My question is, how do I make the template aware of the x variable?


Ben Orozco
Jun 18 2015 14:37
Hi! Is there a recommended approach/boilperplate to include Bootstrap 3 along with Webpack and CommonJS (+ npm)?
PatrickJS []
Jun 18 2015 19:16

@EladRK soon they will support styles in the View decorator annotation so you could either do (in the future next release) still using webpack

  template: require('./home.html'),
  style: require('./home.css')

without webpack or any other module system, while still in node, then you would use angular itself

  templateUrl: ‘./home.html’
  styleUrl: ‘./home.css’