The implementation just smacks of AngularJS. In fact, implementing something like this would be just short of trivial using Angular...!
If you like the concept of "extending html" as used here then you should probably checkout AngularJS: http://angularjs.org