kendoValidator acces to Angular2 component property

社会主义新天地 提交于 2019-12-10 11:49:00

问题


I am using Kendo Upload in my Angular 2 application.I have inject servcie for error message and file permissible size,but when KendoValidator called, this.service is already undefined.

 export class MyUpload implements AfterViewInit {

  private message:string="message error":


    constructor() {
    }



    ngAfterViewInit(): any {
         $("#files").kendoUpload({
            multiple: false

        });
        $("#uploadForm").kendoValidator({
            messages: {
                fileSize: message
            },
            rules: {
                fileSize: function (e: any) {

                   return ....;
                }
            },
            validateOnBlur: false
        });
    }

How can I use this.service for getting size and message?

来源:https://stackoverflow.com/questions/39848910/kendovalidator-acces-to-angular2-component-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!