ng-model for `<input type=“file”/>` (with directive DEMO)

后端 未结 12 2287
北恋
北恋 2020-11-21 06:40

I tried to use ng-model on input tag with type file:


But after selecting a file, in

12条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-21 06:54

    Hi guys i create a directive and registered on bower.

    this lib will help you modeling input file, not only return file data but also file dataurl or base 64.

    {
        "lastModified": 1438583972000,
        "lastModifiedDate": "2015-08-03T06:39:32.000Z",
        "name": "gitignore_global.txt",
        "size": 236,
        "type": "text/plain",
        "data": "data:text/plain;base64,DQojaWdub3JlIHRodW1ibmFpbHMgY3JlYXRlZCBieSB3aW5kb3dz…xoDQoqLmJhaw0KKi5jYWNoZQ0KKi5pbGsNCioubG9nDQoqLmRsbA0KKi5saWINCiouc2JyDQo="
    }
    

    https://github.com/mistralworks/ng-file-model/

    Hope will help you

提交回复
热议问题