I installed ngx-clipboard as mentioned in the documentation and included the js in systemjs.config as well. However I am getting below error:
Unhandled Promise rejection: Template parse errors:
Can't bind to 'ngxClipboard' since it isn't a known property of 'button'. (" </div>
Here is my template:
<div class="col-xs-12 share-pageurl-label">
<a #copyTarget>{{pageURL}}</a>
</div>
<div class="col-xs-12 share-copy-btn">
<button [(ngxClipboard)]="copyTarget" (cbOnSuccess)="linkCopied()"
[ngClass]="{linkCopied: isCopied}">
{{copyBtnLabel}} <span *ngIf="isCopied" class="glyphicon glyphicon-ok"></span>
</button>
</div>
I believe you'll get this error if you have not imported the ClipBoardModule correctly. If you have nested modules and want to use in a lower level, you'll have to make sure that you export this on a parent module, and import on a child module.
parent.module
import { ClipboardModule } from 'ngx-clipboard';
@NgModule({
declarations: [],
imports: [
ClipboardModule
],
exports: [
ClipboardModule,
]
})
export class ParentModule {
}
child.module
import { ParentModule } from '../../parent.module';
@NgModule({
imports: [
ParentModule,
],
declarations: []
})
export class ChildModule {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With