Re: [whatwg] HTML6 proposal for single-page apps without Javascript

> On Mar 23, 2015, at 8:46 AM, Sandro Paganotti <sandro.paganotti@gmail.com> wrote:
> 
> To me it sounds a quite elegant solution to use web components to extend
> the existing elements, for example by using the is attribute, to allow them
> to actually fetch a specific resource from web as you suggested. Using this
> technique would also allow other developers to extend the new behaviour in
> order to embrace various specific use cases.
> 
> -sandro

I don’t see that as a clean solution at all.  Web developers still have to learn the inherited model class

So, instead of:

	<ARTICLE model=“myArticleData”>

You’re asking web developers to do something like:

	var proto = Object.create(HTMLArticleElement.prototype, {   // some type of initial element definition 
 	       model: {
   	         get: function() { …  },  
   	         set: function() { …  }, 
        	});
	proto.createdCallback = function(model) {	// now we have to attach an event listener to the model
		model.addEventListener(‘change’, function(e) {
			e.target.model.set( model )
		});
	} 
	var xArticle = document.registerElement(‘x-article', {     // now register the element
 		prototype: proto, 
		extends: ‘article'
	});

	<ARTICLE is=“X-ARTICLE” model=“myArticleData">   // and then use a different name

(And this is the simplified version...)

-bobby
---
Bobby Mozumder
Editor-in-Chief
FutureClaw Magazine
mozumder@futureclaw.com <mailto:mozumder@futureclaw.com>
+1-240-745-5287
www.futureclaw.com <http://www.futureclaw.com/>
twitter.com/futureclaw <https://www.twitter.com/futureclaw>
www.linkedin.com/in/mozumder <http://www.linkedin.com/in/mozumder>

Received on Monday, 23 March 2015 14:06:07 UTC