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

25th
Aug 2016
Elyor Latipov
@elyor0529
Aug 25 2016 10:31
hi all
This message was deleted
I have question
Can I impl select2 for angular2-webpack-starter statup package?
rvalimaki
@rvalimaki
Aug 25 2016 10:51
@elyor0529 I don't think I understood the question. So do you want to use Select2 with your own application, that you have created with angular2-webpack-starter, or do you wan't to modify angular2-webpack-starter seed to include Select2?
Never used Select2, but I do use some jQuery with Angular2, though I am usually trying to avoid that as much as I can
So, the preferred way would be to search a proper Angular2 alternative for Select2
saurabh agrawal
@saurabh531
Aug 25 2016 10:56
Hi All, Has anyone configured this starter project for angular universal? I am trying to configure it but I am not very familiar with webpack. any input would be a great help here.
rvalimaki
@rvalimaki
Aug 25 2016 10:56
@elyor0529 ...annnnnnnd there you go: https://www.npmjs.com/package/angular2-select2
Elyor Latipov
@elyor0529
Aug 25 2016 10:57
@rvalimaki hmm
@rvalimaki thx I trying now
rvalimaki
@rvalimaki
Aug 25 2016 10:58
Not tested that though, but hopefully that works. I need similar function soon myself in my own project.
Elyor Latipov
@elyor0529
Aug 25 2016 10:58
) k
rvalimaki
@rvalimaki
Aug 25 2016 11:00
Oh well, seems to be an empty repository. No code...
@elyor0529 check this instead: http://valor-software.com/ng2-select/
Elyor Latipov
@elyor0529
Aug 25 2016 11:04
@rvalimaki thx man
Jimit Ndiaye
@jimitndiaye
Aug 25 2016 11:06

@JoshElias

Is this an appropriate way to use sass?
```
@Component({
...
// webpack.config.common
{
test: /.scss$/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!sass-loader'
}

// inside component
SampleComponent ],
styles: [ require( "./sample.component.scss") ]
})
`` I'm getting an error that I'm getting the following errorExpected 'styles' to be an array of strings.`

Jimit Ndiaye
@jimitndiaye
Aug 25 2016 11:13
@JoshElias Your problem is that you're using style-loader for ALL scss files. Style loader actually loads the css by adding it to your <head> tag in your html document. If you're trying to assign it to an inline style as you're doing in your component, you can't use style-loader. Instead you need something like to-string-loader or raw-loader since the styles array expects strings
eg:
      // all css required in src/app files will be merged in js files
      {
        test: /\.scss$/,
        exclude: /\app.(ios|md|wp).scss$/,//helpers.root('src/app'),
        loader: 'raw!postcss!sass'
      },
Jimit Ndiaye
@jimitndiaye
Aug 25 2016 12:56
i came across some recent changes in angular2-webpack-starter (might have been angular2-seed) that demonstrated HMR which rc5 and ngrx/store but I can't seem to find it again. Does anyone have a source/example I can look at?
cc: @gdi2290