mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Refactor the file-system-access API to be synchronous. Added *Sync equivalents of the file-system APIs. Removed usage of file-system-access within the code.
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import observable = require("data/observable");
|
||||
import fs = require("file-system");
|
||||
import fileSystemAccess = require("file-system/file-system-access");
|
||||
|
||||
var fileAccess = new fileSystemAccess.FileSystemAccess();
|
||||
|
||||
export class WebViewModel extends observable.Observable {
|
||||
constructor() {
|
||||
super();
|
||||
fileAccess.readText(fs.path.join(__dirname, "style.css"), (result) => { this._css = result; });
|
||||
var file = fs.File.fromPath(fs.path.join(__dirname, "style.css"));
|
||||
this._css = file.readTextSync();
|
||||
}
|
||||
|
||||
private _url: string;
|
||||
@@ -19,19 +17,6 @@ export class WebViewModel extends observable.Observable {
|
||||
this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "url", value: value });
|
||||
}
|
||||
|
||||
//private _text: string;
|
||||
//get text(): string {
|
||||
// return this._text;
|
||||
//}
|
||||
//set text(value: string) {
|
||||
// this._text = value;
|
||||
// this.notify({ object: this, eventName: observable.Observable.propertyChangeEvent, propertyName: "text", value: value });
|
||||
|
||||
// if (application.ios) {
|
||||
// this.url = this.text;
|
||||
// }
|
||||
//}
|
||||
|
||||
private _css: string;
|
||||
get css(): string {
|
||||
return this._css;
|
||||
|
||||
Reference in New Issue
Block a user