如何在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)
但它不起作用.
我试图使用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) 我正在进行网络语音识别.
我发现Google为开发人员提供了一个名为"Google speech API V2"的API.但我注意到每天都有限制使用它.
之后我发现有一个原生的WEB Speech API也可以实现语音识别.它只是在谷歌Chrome和歌剧:
http://caniuse.com/#feat=speech-recognition
那么1.什么是不同的Google Speech API和Web Speech API?他们有关系吗?
谢谢.
<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的高度渲染后得到元素的高度/宽度?
如何在Ionic 2中隐藏带有标签的导航栏?
我只想将其隐藏在其中一个页面中,不包括其他页面.
<ion-navbar *navbar >
<ion-title>Item Details</ion-title>
</ion-navbar>
Run Code Online (Sandbox Code Playgroud)
我试过hide-nav-bar="true"但它不起作用.