x-tag / x-tag.github.io

The X-Tag website
MIT License
7 stars 7 forks source link

Update docs to expose/detail default XTagElement render() features #17

Open csuwildcat opened 6 years ago

csuwildcat commented 6 years ago

Need a section detailing this feature/API

ghost commented 6 years ago

I was thinking that as well, I will look if I actually started to do any think regarding that. I don't believe so. I will have time to work on this tonight. It will get added to the pull request commits.

ghost commented 6 years ago

Sorry I just now am starting to take a dive into this now. I'm going to start this topic right before the The DL on Events section and make reference to it in intro material of Content is King section.`

@csuwildcat how does that sound?

ghost commented 6 years ago

The section before mentions guides on pseudos' and extensions I think that the repo wiki would be a good place to house contributor created guides, did you have a different place to put contributor ones or did you want to reference a different guide or none at all?

The reason I ask is that I am going to mention how the render() method plays it role in the ::template and it would be nice to be able to mention guides that involve use of libs like cytoscape. EDIT -- At least as far as place to go that is verifiable and safe.

ghost commented 6 years ago

I used the snippet below for an example, will this do?

var _rendered = xtag.create( "x-mode", class extends XTagElement {
  set 'mode::attr'(_mode) {
    this.render(_mode);
    return _mode;
  }
  get 'mode::attr'(){ 
    return this.getAttribute("mode"); 
  },
  'myModeSnippet::template'() {
    return "My creation has come to be,Rendered.";
  }
  'click::event'(e){
    e.target.mode = e.target.mode;
  }
} );

EDIT = > :) Just tested the above code on my windows machine and it worked as expected.