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

26th
Aug 2016
matthew harwood
@matthewharwood
Aug 26 2016 03:33

if you have a component and inject a directive into the componenet, is it possible to append that directive attribute to the host element? e.g:

app.component.ts

@Component({
  selector: 'app',
  encapsulation: ViewEncapsulation.None,
  styleUrls: [
    './app.style.css'
  ],
  directives: [
    MhScroll
  ]

index.html

<body>

<app mh-scroll>
loading...
</app>
</body>

this totally mh-scroll works if I append teh directive to the inner component template but not the host itself.

Anselm
@anselmhou
Aug 26 2016 09:57
Hi experts, just notice the latest updates on the project that the path: 'detail', loadChildren: () => System.import('./+detail') instead of previous using es6-promise. So we are now mixing SystemJS and webpack now ...?
Artem
@Ledzz
Aug 26 2016 13:39

Hello to all! Can you help me please? I've justed forked the angular2-webpack-starter repo and trying to make stylus compilation work.
I've added stylus loader to webpack.common.js:

{
    test: /\.styl$/,
    exclude: /node_modules/,
    loader: 'raw-loader!stylus-loader'
}

and changed app.component.ts:

styles: [
    require('./app.style.styl')
],

It works. But if I use HMR (I start the server like npm run server:dev:hmr) it doesn't reload when I delete some lines in stylus file. For example:

I add the following code:

body
    background red

Result: app updates and changes the background.

I remove two lines added.
Result: I got messages in console, but app does not update.
In console I don't see lines about stylus changes.
And if I reload manually I see the changes.
Why this happens?

Shahmir Noorani
@shahmirn
Aug 26 2016 21:53

hey guys. I'm trying to update my code to use webpack2, simiar to the repo, and I'm getting:

ERROR in [default] C:/dev/RO.View.Dashboard/View/Slb.Prism.RO.View.Dashboard/node_modules/@types/protractor/index.d.ts:1
844:12
Subsequent variable declarations must have the same type. Variable '$' must be of type 'JQueryStatic', but here has typ
e 'cssSelectorHelper'.