【问题标题】:nativescript textfield ngModelChangenativescript 文本字段 ngModelChange
【发布时间】:2017-02-06 19:05:38
【问题描述】:
<GridLayout row="1" columns="*">
<TextField hint="Station name" col="0" [ngModel]="stationName" (ngModelChange)="stationTyping($event)"></TextField>
</GridLayout>

这是给出错误:

Found peer TypeScript 2.0.10
12:31:01 AM - Compilation complete. Watching for file changes.

Error: watch /var/www/html/train-locator/node_modules/adm-zip/headers ENOSPC
    at exports._errnoException (util.js:1036:11)
    at FSWatcher.start (fs.js:1429:19)
    at Object.fs.watch (fs.js:1456:11)
    at createFsWatchInstance (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/usr/local/lib/node_modules/nativescript/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:123:15)

有时它会在一个 node_module 上出错,有时在另一个 mode_module 上会出错。这个错误是什么意思? 这里可能有什么问题?

【问题讨论】:

    标签: angular nativescript angular2-nativescript


    【解决方案1】:
    ENOSPC === no space left on device
    

    这通常发生在使用 200MB 空间(默认值)创建的模拟器并且您已经安装了多个应用程序(在调试模式下大于发布时,200mb 通常不足以测试多个应用程序的空间)/。解决方案是编辑您的模拟器以使用更多空间或删除一些已安装的应用程序。

    【讨论】:

    • 我用的是安卓手机,剩余空间超过2GB。这个问题是在我将 nativescript 升级到 2.5 后出现的
    【解决方案2】:

    嗨:这里我如何使用事件侦听器来捕获输入值。

    //template...
    <TextField 
            #revqrt
            [(ngModel)]="fd_recqty" 
            keyboardType="number">
    </TextField>
    
    //ts file
    
    ...
    import { fromEvent } from 'rxjs';
    import 'rxjs/add/operator/map';
    import 'rxjs/add/operator/debounceTime';
    ...
    
    ngAfterViewInit(): void {
     this.$qtyListener= fromEvent(
         this.receiptQty.nativeElement, 'textChange')
         .debounceTime(400)
         .subscribe((event:any) => {
            console.log(event.value); //this this input value
      });
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-31
      • 2016-07-11
      • 2018-09-13
      • 2019-11-12
      相关资源
      最近更新 更多