I recently upgraded my project to angular-cli@webpack in angular RC5.
I installed lodash using :
npm install lodash --save
then In my ts files, I am using it as:
import { Component, OnInit, Type, Input, OnChanges, ViewContainerRef, ViewChild } from '@angular/core';
declare var _:any;
@Component({
selector: 'property-editor',
templateUrl: 'property-editor.component.html',
styleUrls: ['property-editor.component.css']
})
export class PropertyEditorComponent implements OnInit, OnChanges {
@Input('component-name') componentName: string;
@Input('component-model') componentModel: RapidColumn;
counter: number = 0;
constructor() { }
ngOnInit() {
console.log(this.isArray(this.componentModel));
}
//============================Data Type Operations==============================//
isArray(data:any):boolean{
return _.isArray(data);
}
isObject(data:any){
return _.isObject(data);
}
isString(data:any):boolean{
return _.isString(data);
}
}
But whenever I am trying to import it in my .ts files its giving errors.
any inputs?