Does angular 2.0 store values of variables on serv

2020-05-02 00:11发布

问题:

I cloned official angular 2.0 quick start projectand try to add side-navigation panel. I created simple component wich contains following:

export class AppComponent {
    menuVisible: boolean = false;
    toggleVisible() { this.menuVisible = !this.menuVisible; }
}

And simple template (pug):

side-navigation([class.visible]="menuVisible === true") 
    div(*ngIf="!menuVisible", (click)="toggleVisible()", style="cursor: pointer; font-size:1vw") ☰
    ul(*ngIf="menuVisible")

But when I've tried to test this component I get weird issue: Sometimes I click the open dide panel button in Google Chrome (just for example this issue does not depend on any browser), I see that side-navigation bar opens in another browser (Edge). I don't know how to fix it. Is it my problem or some kind of bug?

回答1:

That the browsersync feature of your server.

See also

  • For Angular2, why do two pages (two tabs) having the same component affect each other?
  • I use gulp . project is on Angular 2. How to delete browser-sync from the project?


标签: angular