- from windows cmd:
tns create helloWorkspace
- at helloWorkspace/app level ensure: [tns8] Embedding S8 environment in your app
- replace default stackLayout code in /helloWorkspace/app/main-page.xml with:
<StackLayout class="p-20">
<Label text="Tap to evaluate an S8 expression" class="h1 text-center"/>
<TextField id="s8expression" hint="s8 expression" text="{{ s8expression }}" />
<Button text="showIt" tap="{{ onTap }}" class="btn btn-primary btn-active"/>
<Label id="evaluation" text="{{ evaluation }}" class="h2 text-center" textWrap="true"/>
</StackLayout>
- replace default /helloworld/app/main-view-model.js with:
var Observable = require("data/observable").Observable;
var s8 = require("./s8");
function createViewModel() {
var viewModel = new Observable();
viewModel.s8expression = "Smalltalk classes size";
viewModel.evaluation = "[tap to get result of evaluation]";
viewModel.onTap = function() {
this.set("evaluation",viewModel.s8expression.showIt());
}
return viewModel;
}
exports.createViewModel = createViewModel;
- to run the app in
- android execute:
tns run android
- iOS execute:
ins run iOS