sedwards2009 / dojo-typescript-class Goto Github PK
View Code? Open in Web Editor NEWAn experiment aimed at using TypeScript to create Dojo classes.
License: MIT License
An experiment aimed at using TypeScript to create Dojo classes.
License: MIT License
Hello,
I have been playing around with this technique and agree that it is, in most ways, superior to the one that I had come up with. Only one problem that I see: for templated widgets, I can't find an order that instantiates the widget correctly.
The canonical way to try this would be something like:
///<amd-dependency path="dojo/text!./_templates/template.html" />
/// <reference path="../../typings/dijit.d.ts" />
import dojoClass = require("app/dojoClass");
import _WidgetBase = require("dijit/_WidgetBase");
import _TemplatedMixin = require("dijit/_TemplatedMixin");
var template: string = require("dojo/text!./_templates/RulesView.html");
class Foo extends dijit._WidgetBase {
templateString: string = template;
constructor(params?: Object, elem?: HTMLElement) {
super();
dojoClass.construct(this, params, elem);
}
}
dojoClass.create(Foo, [_WidgetBase, _TemplatedMixin]);
export=Foo;
however, this causes the application to try to new up the super (dijit._WidgetBase) and the new widget. This causes Dojo to throw an error since it tries to double instantiate this widget and assign them both the same ID.
If we can find a way around this, then I think it addresses all of the use cases in a much more efficient way. I'll keep working on it and update this issue if I find anything.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.