December 2016
Intermediate to advanced
841 pages
17h
English
Let's create a new file named chart_model.ts under the app/models directory. This is the last model that we will implement:
/// <reference path="../../framework/interfaces"/>
import { Model, AppEvent, ModelSettings } from "../../framework/framework";
@ModelSettings("http://dev.markitondemand.com/Api/v2/InteractiveChart/jsonp")
class ChartModel extends Model implements IModel {
constructor(metiator : IMediator) {
super(metiator);
}
// listen to model events
public initialize() {
this.subscribeToEvents([
new AppEvent("app.model.chart.change", null, (e, args) => { this.onChange(args); })
]);
}
// dispose model events
public dispose() {
this.unsubscribeToEvents();
}This time, we will need to format both the request and ...
Read now
Unlock full access