angular 2.0是否在服务器端存储变量的值? [英] Does angular 2.0 store values of variables on server side?

查看:63
本文介绍了angular 2.0是否在服务器端存储变量的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了官方的angular 2.0快速入门项目,并尝试添加侧面导航面板.我创建了一个简单的组件,它包含以下内容:

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

和简单模板(pug):

And simple template (pug):

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

但是当我尝试测试此组件时,我遇到了奇怪的问题: 有时,我单击Google Chrome中的打开dide面板按钮(例如,此问题不依赖于任何浏览器),我看到侧面导航栏在另一个浏览器(Edge)中打开.我不知道该如何解决.是我的问题还是某种错误?

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?

推荐答案

服务器的浏览器同步功能.

That the browsersync feature of your server.

另请参见

  • 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 2.0是否在服务器端存储变量的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆