From 08923409e172eeb8e2aae5f4794399a373eef359 Mon Sep 17 00:00:00 2001 From: Sam Lin Date: Fri, 16 Dec 2016 12:23:30 -0600 Subject: [PATCH] feat(compile): support AoT use module ES6 instead of commonjs --- src/clipboard.directive.ts | 6 +++--- tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/clipboard.directive.ts b/src/clipboard.directive.ts index 8905241..7552b99 100644 --- a/src/clipboard.directive.ts +++ b/src/clipboard.directive.ts @@ -1,5 +1,5 @@ -import {Directive, ElementRef, Input, Output, EventEmitter, OnInit, OnDestroy } from '@angular/core'; -import Clipboard = require('clipboard'); +import { Directive, ElementRef, Input, Output, EventEmitter, OnInit, OnDestroy } from '@angular/core'; +import * as Clipboard from 'clipboard'; @Directive({ selector: '[ngIIclipboard]' @@ -18,7 +18,7 @@ export class ClipboardDirective implements OnInit, OnDestroy { constructor(private elmRef: ElementRef) { } ngOnInit() { - let option: ClipboardOptions; + let option: Clipboard.Options; option = !!this.targetElm ? { target: () => this.targetElm } : { text: () => this.cbContent }; this.clipboard = new Clipboard(this.elmRef.nativeElement, option); this.clipboard.on('success', () => this.onSuccess.emit(true)); diff --git a/tsconfig.json b/tsconfig.json index 4a78bce..eae6e99 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,7 @@ "es6", "dom" ], - "module": "commonjs", + "module": "es6", "moduleResolution": "node", "noEmitOnError": false, "noImplicitAny": false,