本文整理匯總了TypeScript中models/mixins/new_validatable_mixin.ValidatableMixin類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ValidatableMixin類的具體用法?TypeScript ValidatableMixin怎麽用?TypeScript ValidatableMixin使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ValidatableMixin類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(material: Material, task: Task) {
ValidatableMixin.call(this);
this.material = stream(material);
this.task = stream(task);
this.validateAssociated("material");
this.validateAssociated("task");
}
示例2: constructor
protected constructor(name: string,
autoUpdate: boolean,
errors: { [key: string]: string[] } = {}) {
super();
this.name = stream(name);
this.autoUpdate = stream(autoUpdate);
ValidatableMixin.call(this);
this.errors(new Errors(errors));
}
示例3: constructor
constructor(directive: string, action: string, type: string, resource: string) {
super();
ValidatableMixin.call(this);
this.directive = stream(directive);
this.action = stream(action);
this.type = stream(type);
this.resource = stream(resource);
this.validatePresenceOf("directive");
this.validatePresenceOf("action");
this.validatePresenceOf("type");
}
示例4: constructor
constructor(id?: string, pluginId?: string, properties?: Configurations) {
this.id = stream(id);
this.pluginId = stream(pluginId);
this.properties = stream(properties);
ValidatableMixin.call(this);
this.validatePresenceOf("pluginId");
this.validatePresenceOf("id");
this.validateFormatOf("id",
new RegExp("^[-a-zA-Z0-9_][-a-zA-Z0-9_.]*$"),
{message: "Invalid Id. This must be alphanumeric and can contain underscores and periods (however, it cannot start with a period)."});
this.validateMaxLength("id", 255, {message: "The maximum allowed length is 255 characters."});
}