本文整理汇总了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."});
}