Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR in node_modules/angular2-color-picker/node_modules/rxjs/Subject.d.ts(24,5): #126

Open
cstslqq opened this issue Aug 21, 2018 · 3 comments

Comments

@cstslqq
Copy link

cstslqq commented Aug 21, 2018

ERROR in node_modules/angular2-color-picker/node_modules/rxjs/Subject.d.ts(24,5): error TS2416: Property 'lift' in type 'Subject' is not assignable to the same property in base type 'Observable'.
Type '(operator: Operator<T, R>) => Observable' is not assignable to type '(operator: Operator<T, R>) => Observable'.
Type 'Observable' is not assignable to type 'Observable'.
Type 'T' is not assignable to type 'R'.

@goldiwill
Copy link

我在 Angular5 上面使用当前的依赖包也存在上面的问题。我把源码下载下来做如下小小修改就可以 跑了
解决办法:

  1. 找到 color-picker.directive.ts 文件
  2. 修改注入器 const injector = ReflectiveInjector.fromResolvedProviders([], this.vcRef.parentInjector);const injector = Injector.create([], this.vcRef.parentInjector);
    3.使用,如果你把 color-picker 放到 shareModule ,需要做如下处理:
//share.module.ts

@NgModule({
    imports:[ColorPickerModule],
   exports:[ColorPickerModule]
})
export class SharedModule {
   ...
}

 <span class="c-color-picker" [(colorPicker)]="color" [style.background]="color"></span>

@gisarjun
Copy link

I'm Angular5using the current dependencies on top of the above problems also exist. I downloaded the source code and made the following small modifications to run.
Solution:

  1. Find the color-picker.directive.ts file
  2. Modify the injector const injector = ReflectiveInjector.fromResolvedProviders([], this.vcRef.parentInjector); to const injector = Injector.create([], this.vcRef.parentInjector);
    3. Use, if you put color-pickerinto shareModule, needs to be handled as follows:
//share.module.ts

@NgModule({
    imports:[ColorPickerModule],
   exports:[ColorPickerModule]
})
export class SharedModule {
   ...
}

 <span class="c-color-picker" [(colorPicker)]="color" [style.background]="color"></span>

I couldn't find Injector create in angular/core. Can share how it works?

@wuzhenda
Copy link

#123 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants