angular2 上的开关按钮使用 Typescript
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/35453788/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
on-off button on angular2 using Typescript
提问by user2247651
I am using angular2
with typescript
.
How can I create an on - off
button?.
我使用angular2
带typescript
。
如何创建on - off
按钮?
回答by Pardeep Jain
Yes for you here is a stylish Switch (on/off toggle) using Bootflat theme (i have used Bootflat theme for styling refer here). Just Put this code as HTML
and some styles you have to add.
是的,这里是使用 Bootflat 主题的时尚 Switch(开/关切换)(我使用 Bootflat 主题进行样式设计,请参阅此处)。只需将此代码作为HTML
您必须添加的一些样式即可。
here is Code for Switch:
这是开关代码:
<label class="toggle col-sm-8">
<input type="checkbox"(click)="Existing()">
<span class="handle" style="top:0 !important"></span>
</label>
<h2 class='bg-danger'>Your Switch value Is : {{value}}</h2>