【发布时间】:2016-11-18 13:52:13
【问题描述】:
我想在 ionic 2 中使用颜色选择器。我使用来自here 的 angular2-color-picker。根据 doc 文件夹添加的页面/颜色选择器。请帮助我缺少一些东西或者我该怎么办?
获取错误
没有 ColorPickerService 的提供者!
我的.html
<ion-input [(colorPicker)]="color" [style.background]="color" [value]="color"></ion-input>
我的.ts
import {ColorPickerDirective} from '../color-picker/color-picker.directive'
@Component({
templateUrl: 'build/pages/trans-generation/trans-generation.html',
directives: [ColorPickerDirective]
})
export class TransGeneration {
private color: string = "#127bdc";
}
app.ts
import {TransGeneration} from './pages/trans-generation/trans-generation';
import {ColorPickerService} from './pages/color-picker/color-picker.service'
ionicBootstrap(MyApp,TransGeneration, [ColorPickerService])
【问题讨论】:
-
你能得到非圆角拾色器吗?
-
no..error message "No provider for ColorPickerService!"
-
你已经看过这个other SO thread了吗?
标签: jquery angular ionic-framework ionic2