noppa / ng-hot-reload

Hot reloading for AngularJS apps.
MIT License
43 stars 8 forks source link

Make it work for hybrid app #16

Open YonathanB opened 5 years ago

YonathanB commented 5 years ago

I added some angular 7 components in my project. ng-hot-reload doesn't refreshing these components. do you have an idea how can I make it work?

index.js:

import {AppModule} from './application/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);

app.module:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static';
import {WhiteLabelComponent} from "./components/white-label/whiteLabel.component";

@NgModule({
    imports: [
        BrowserModule,
        UpgradeModule
    ],
    declarations:[
        WhiteLabelComponent
    ],
    entryComponents:[
        WhiteLabelComponent
    ]
})

export class AppModule {
    constructor(private upgrade: UpgradeModule) { }
    ngDoBootstrap() {
        this.upgrade.bootstrap(document.body, ['mainModule'], { strictDi: true });
    }
}

angular 7 component: import {Component, OnInit} from '@angular/core';

@Component({
    selector: 'white-label',
    template: require('./white-label.html')//template
})
export class WhiteLabelComponent implements OnInit {
    appTitle: string = 'myapp';
}