ng-hot-reload icon indicating copy to clipboard operation
ng-hot-reload copied to clipboard

Make it work for hybrid app

Open YonathanB opened this issue 5 years ago • 0 comments

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';
}

YonathanB avatar Feb 25 '19 13:02 YonathanB