小编Kim*_*ong的帖子

如何在ionic2/angular2中设置动态ID(*ngFor)?

如何在angular2中设置动态ID?

我试过了

<div class = "CirclePoint" *ngFor="#c of circles" id = "{{ 'Location' + c.id }}"></div>

this.circles = [
        { x: 50 , y: 50 ,id : "oyut1" },
        { x: 100 , y: 100 ,id : "oyut3"  },
        { x: 150 , y: 150 ,id : "oyut2"  }
];
Run Code Online (Sandbox Code Playgroud)

但它不起作用.

ionic2 angular

56
推荐指数
3
解决办法
7万
查看次数

如何在angular2中使用[(ngModel)] div的contenteditable?

我试图使用ngModel双向绑定div的contenteditable输入内容,如下所示:

<div id="replyiput" class="btn-input"  [(ngModel)]="replyContent"  contenteditable="true" data-text="type..." style="outline: none;"    ></div> 
Run Code Online (Sandbox Code Playgroud)

但它无法正常工作并发生错误:

EXCEPTION: No value accessor for '' in [ddd in PostContent@64:141]
app.bundle.js:33898 ORIGINAL EXCEPTION: No value accessor for ''
Run Code Online (Sandbox Code Playgroud)

contenteditable ionic2 angular

48
推荐指数
5
解决办法
4万
查看次数

Google Speech API和Web Speech API之间存在差异

我正在进行网络语音识别.

我发现Google为开发人员提供了一个名为"Google speech API V2"的API.但我注意到每天都有限制使用它.

之后我发现有一个原生的WEB Speech API也可以实现语音识别.它只是在谷歌Chrome和歌剧:

http://caniuse.com/#feat=speech-recognition

那么1.什么是不同的Google Speech API和Web Speech API?他们有关系吗?

  1. 语音识别结果json从谷歌返回.是谷歌语音api会比网络语音api更准确吗?

谢谢.

webspeech-api google-speech-api

14
推荐指数
1
解决办法
5160
查看次数

如何在angular2中获得Dom的高度?

<div style="width:100%;height:100%;position:relative;background-color:white" id ="OuterSvg"> </div>

onPageLoaded(){
     console.log(document.getElementById("OuterSvg").offsetHeight); //get 0.
}   

ngAfterViewInit(){
     console.log(document.getElementById("OuterSvg").offsetHeight); //get 0.
}
Run Code Online (Sandbox Code Playgroud)

我尝试过onPageLoaded()和ngAfterViewInit()但也没有工作...那么如何在dom的高度渲染后得到元素的高度/宽度?

ionic2 angular

12
推荐指数
2
解决办法
2万
查看次数

如何在Ionic 2中隐藏带有标签的导航栏?

如何在Ionic 2中隐藏带有标签的导航栏?

我只想将其隐藏在其中一个页面中,不包括其他页面.

<ion-navbar *navbar   >
  <ion-title>Item Details</ion-title>
</ion-navbar>
Run Code Online (Sandbox Code Playgroud)

我试过hide-nav-bar="true"但它不起作用.

tabs navbar ionic2 ionic3 angular

4
推荐指数
1
解决办法
6329
查看次数