Domanda

Sto cercando un patrimonio sistema standard che può funzionare in entrambi i node.js e browser.

sys.inherits non funziona in vecchi browser (Object.create).

Tutte le js librerie (jQuery, extjs, Dojo ...) hanno simili ma diff sistemi Eredita. (Non so che uno è buono per node.js)

Vuoi usare uno che è semplice e può diventare il "standard" in futuro (almeno in node.js sistema basato).

Qualche idea? Quale stai usando?

Anche scoperto alcuni progetti interessanti:

http://howtonode.org/prototypical-inheritance (Non va bene per IE)

http://jsclass.jcoglan.com/modules.html (Troppo grande, troppo ruby?)

A proposito, sto usando require.js in frontend.

Grazie

È stato utile?

Soluzione

Usa Node.JS lato server sys.inherits, uso qualunque sia il vostro usi quadro nel front-end.

Keep it simple.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top