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

18th
Jun 2015
Lee Gathercole
@LeeGathercole
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?

Thanks

Ben Orozco
@benoror
Jun 18 2015 14:37
Hi! Is there a recommended approach/boilperplate to include Bootstrap 3 along with Webpack and CommonJS (+ npm)?
PatrickJS [tipe.io]
@gdi2290
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

@View({
  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

@View({
  moduleId: module.id,
  templateUrl: ‘./home.html’
  styleUrl: ‘./home.css’
})