我是新的角2.0和使用aspnetboilerplate模板。
我正在尝试集成jQuery-Knob。
首先,我将jquery.knob.min.js包含在scripts in .angular-cli.json中。
"scripts":
[
"../src/bsb-theme/js/jquery.validate.js",
"../src/bsb-theme/js/jquery.knob.min.js"
]然后,我用dashboard.component.html制作了一个dashboard.component.html
<input type="text" class="knob" value="40"
data-width="125"
data-height="125"
data-thickness="0.25"
data-angleArc="250"
data-angleoffset="-35"
data-fgColor="#00BCD4">但输出仅为文本框。
发布于 2017-11-13 18:04:45
jQuery-Knob不工作的盒子外的角度2.
试试这个库:https://github.com/xzegga/angular2-knob
用法
进口角度模块:
import { KnobModule } from "angular2-knob";
@NgModule({
declarations: [
AppComponent
],
imports: [KnobModule]
bootstrap: [AppComponent]
})HTML使用:
<div ui-knob [value]="value" [options]="knOptions"></div>在角组件中配置选项:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent{
knOptions = {
readOnly: true,
size: 140,
unit: '%',
textColor: '#000000',
fontSize: '32',
fontWeigth: '700',
fontFamily: 'Roboto',
valueformat: 'percent',
value: 0,
max: 100
trackWidth: 19,
barWidth: 20,
trackColor: '#D8D8D8',
barColor: '#FF6F17',
subText: {
enabled: true,
fontFamily: 'Verdana',
font: '14',
fontWeight: 'bold',
text: 'Overall',
color: '#000000',
offset: 7
},
}
value = 45;
}https://stackoverflow.com/questions/47265400
复制相似问题