I'm having trouble migrating from ionic beta.11 to RC0. Every time I put a constructor expecting the type "any" I get the following error.
ngc error: Error: Error at /Project/.tmp/app/app.module.ngfactory.ts:456:134: Property 'any' does not exist on type 'typeof "/Project/.tmp/directives/mask"'.
By going to the app.module.ngfactory.ts at line 456 it generates the line below:
if ((this.__MaskDirective_75 == (null as any))) { (this.__MaskDirective_75 = new import45.MaskDirective(this.parent.get(import45.any),this.parent.get('mask'))); }
Here is the code for my policy:
import {Directive, Attribute} from '@angular/core';
@Directive({
selector: '[mask]',
host: {
'(keyup)': 'onInputChange()'
}
})
export class MaskDirective {
maskPattern: string;
placeHolderCounts: number;
dividers: string[];
modelValue: string;
viewValue: string;
constructor(
public model: any,
@Attribute("mask") maskPattern: string
) {
this.dividers = maskPattern.replace(/\*/g, "").split("");
this.dividers.push(" ");
this.generatePattern(maskPattern);
}
onInputChange() {
this.modelValue = this.getModelValue();
var stringToFormat = this.modelValue;
if (stringToFormat.length < 10) {
stringToFormat = this.padString(stringToFormat);
}
this.viewValue = this.format(stringToFormat);
this.model.viewToModelUpdate(this.modelValue);
this.model.valueAccessor.writeValue(this.viewValue)
}
generatePattern(patternString) {
this.placeHolderCounts = (patternString.match(/\*/g) || []).length;
for (let i = 0; i < this.placeHolderCounts; i++) {
patternString = patternString.replace('*', "{" + i + "}");
}
this.maskPattern = patternString;
}
format(s) {
var formattedString = this.maskPattern;
for (let i = 0; i < this.placeHolderCounts; i++) {
formattedString = formattedString.replace("{" + i + "}", s.charAt(i));
}
return formattedString;
}
padString(s) {
var pad = " ";
return (s + pad).substring(0, pad.length);
}
getModelValue() {
var modelValue = this.model.value;
for (var i = 0; i < this.dividers.length; i++) {
while (modelValue.indexOf(this.dividers[i]) > -1) {
modelValue = modelValue.replace(this.dividers[i], "");
}
}
return modelValue;
}
}
What can I do to correct this problem and continue updating my project?