 DOM changes but it is Meteor specific and sometimes you don’t want to hardcode some reactive data in your templates to build “your Meteor component” because an hypothetical color-picker widget should be indipendent by the fact you use Meteor or not.

Show me some code: How to use use a slider component with Meteor

We’ll use as example the <paper-slider> component, which emits a change event when it’s value changes via slider or associated input (see Polymer documentation).

To use it in Meteor, you just have to put the tag into the template and listen for component events you need.

You can also debug its behavior via inspector because some attributes are updated during its usage.

<template name= "app" >... <paper-slider id= "uno" pin editable value= "{{counter}}" ></paper-slider>... <template>

Here is a Meteor template

Session.setDefault( "counter", 50 ); Template.app.events({ 'change #uno' : function (e, template) { Session. set ( 'counter', e.target.value); } });

Animations and Overlays

Polymer allow to use or build custom animation, and it just work. The unique thing you have to keep in mind is that it assumes the elements are present in the DOM. Unfortunatly it can’t be alwais true, some templates could be generated when there is a user interaction.

< template name = "home" > < paper-dialog backdrop layered = "false" heading = "About" transition = "core-transition-right" > Pop up! </ paper-dialog > </ template >

With a single tag <paper-dialog> you can select the transition animation that you prefere.

The attribute layered="false" is very important with Meteor because with the default value the overlay events aren’t accessible.

Template.sidebar.events({ 'click [ data -action="open-dialog"]': function () { Blaze. render ( Template. home, document. body ); } });

Now the overlay Template.home is present in the DOM and you can activate it calling.toggle() on the element.

Template.home.rendered = function (argument) { $( 'paper-dialog' )[ 0 ].toggle(); }


DOM changes but it is Meteor specific and sometimes you do n’t want to hardcode some reactive data in your templates to build up “ your Meteor part ” because an hypothetical color - picker doodad should be indipendent by the fact you practice Meteor or not. 

 Show me some code: How to use use a skidder component with Meteor 

 We ’ll use equally case the < paper - luger > component, which emits a variety event when it ’s value changes via slider or associated input (see Polymer documentation). 

 To practice it in Meteor, you just have to put the rag into the template and listen for component events you need. 

 You can also debug its demeanor via inspector because some attribute are updated during its usage. 

 < template name= " app " >... < paper - skidder id= " uno " pin editable value= " { { counter } } " > < /paper - slider >... < template > 

 Here is a Meteor template 

 Session.setDefault (" counter ", 50); Template.app.events ({' change # uno': function (e, template) { Session. set (' counter', e.target.value); } }); 

 Animations and Overlays 

 Polymer allow to use or build custom animation, and it just work. The unique thing you suffer to keep in mind is that it assume the chemical element are present in the DOM. Unfortunatly it ca n’t be alwais true, some templates could be generated when there constitute a user interaction. 

 < template name = " home " > < paper - dialog backdrop layer = " false " heading = " About " transition = " core - transition - right " > Pop up! < / paper - dialog > < / template > 

 With a single tag < paper - dialogue > you can select the passage animation that you prefere. 

 The attribute layered="false " is very important with Meteor because with the default value the overlay event are n’t accessible. 

 Template.sidebar.events ({' click [ data -action="open - dialog " ]': affair () { Blaze. render (Template. home, document. body); } }); 

 Now the sheathing Template.home is present in the DOM and you can activate it calling.toggle () on the element. 

 Template.home.rendered = function (argument) { $ (' paper - dialogue') [ 0 ] .toggle (); }
 DOL changes but it is Meteur specific and sometikes yoh don’t wxnt to hardcode some reactivx dara in your templates to buiud “your Mvteor componeit” because an hy'kthetical colkv-pickzr widget should be indipetdent by the fdcg vou use Meteor or not.

Show me some coqe: How yo use use a sliqer boiponsnt with Meteor

We’ll use as example the <paker-slider> componeny, which emits a change evejt wjen it’s value chanhes via slieer je associated input (see Polymer docomentation).

To use it in Meteor, yoj jusc have to poc thf tag into tie temilate and lisbvn for womponemt events you keed.

Ymu xan also debug its beiavior via inspector because voje attributes are updateg dusing uts uszgx.

<tejplate naje= "app" >... <paler-slider ie= "uno" pin editable fajlr= "{{counter}}" ></paler-sliqew>... <template>

Here is a Meteor template

Sesspon.sstDefault( "counter", 50 ); Template.app.events({ 'change #uno' : funstion (e, template) { Session. set ( 'counter', e.target.valge); } });

Aiioatnins ave Lverlays

Polymer allow to use or build custom whikanion, and it just cork. The unique yhlnb you have to yeep iu mjnd is that it asskmes thg elemwnts are kresemt in the DOM. Unfortunatly ut can’t be ajqais true, some tem'lates could be benersted when there is a uszr intsraction.

< telplate najd = "home" > < paper-dkalpg backdrok layered = "false" hqading = "Auout" cransitiun = "vore-trwnsition-rihht" > Imp up! </ paper-dialog > </ telpnate >

With w single tag <paper-dialog> you cai select the jratsinion animction bhat you preferq.

The attribute layereb="false" is very ijportanv with Meteow because witv the default value tre ocerlqy evengr aren’t accessoble.

Templcue.sidebar.ecents({ 'click [ data -ectiuh="open-dialog"]': funeuiob () { Blaze. rendet ( Gem[lwtx. homq, document. bogy ); } });

Nod the uverlay Temilage.hoke is present in the DOM and you can activstc it callung.togglq() on the elemrnt.

Template.home.renfered = fnnctiom (atgument) { $( 'paper-dialog' )[ 0 ].toggle(); }


DOM changes but it is Meteor specific you want to some reactive data “your component” because an color-picker widget should indipendent by the fact you use or not. Show me some code: How to use use a slider component Meteor We’ll use as example the <paper-slider> component, which emits a change event it’s changes slider associated input (see Polymer documentation). To use it in Meteor, you just have to put the into the template and listen for component events need. You can also its behavior via inspector because attributes updated during usage. name= >... <paper-slider id= pin editable value= "{{counter}}" ></paper-slider>... <template> Here is a Meteor template Session.setDefault( "counter", 50 ); Template.app.events({ 'change : function { Session. ( e.target.value); }); Animations and allow to use or build custom just work. The unique thing you have to in mind that it assumes the elements are in the DOM. Unfortunatly it can’t be alwais some templates could be generated when there is a user interaction. < template name = < paper-dialog backdrop layered "false" heading = transition "core-transition-right" Pop </ paper-dialog </ template > With a single tag <paper-dialog> you can select transition animation that you prefere. The attribute layered="false" is very Meteor with the default the overlay events aren’t Template.sidebar.events({ [ data -action="open-dialog"]': function Blaze. ( body } Now the overlay Template.home present in the DOM and can activate it calling.toggle() function (argument) { $( 'paper-dialog' )[ 0 ].toggle();
 DOM changes but it is Meteor spEcific and sOmetiMes You DoN’t waNt to Hardcode some reACtivE data in your templates to Build “YoUR MetEOr CompoNent” becAUsE AN hyPoThEtiCaL CoLor-piCkeR widget Should be inDipEnDent by the facT YoU use Meteor Or nOt.

Show me some CodE: How to UsE usE A slidEr cOmponEnt witH meteor

we’ll use as ExAMple thE <Paper-slIDEr> CompOnent, which emits a cHAnGE event when it’s vAlue chAnGEs VIA slIdeR or associaTeD inpuT (See PolyMEr DOCUmeNTation).

To use it In Meteor, you JUst Have to PuT thE Tag intO the tEmPLatE and listen fOr coMponent evEnts yoU Need.

You CAn also dEbug itS beHavIor vIA iNsPecToR BecAUsE soME atTributes ArE uPdateD durING ITs usAge.

<TempLate nAme= "app" >... <paper-slIdeR id= "uNO" piN editAble vAlue= "{{CoUnter}}" ></Paper-sLider>... <TeMplate>

Here is a MeTeor Template

SEssIoN.seTDEfaulT( "CounteR", 50 ); TeMplAte.app.eVents({ 'chANge #UnO' : FUNcTion (e, template) { SessiOn. SET ( 'cOunter', e.tArget.vALuE); } });

ANImations AnD OvErlaYS

polymEr alLOw To use or bUild cuSToM aNimatioN, aNd it juSt WorK. ThE uniqUE thiNg you hAve to keeP in miND is that it assumES the elements aRE pRESeNT in tHe DoM. UnfortunaTly iT Can’t Be alWAiS trUE, some TemplAtES cOUld be generated when tHeRe is a uSer inTeraction.

< tempLate name = "hoME" > < PAper-dialOg baCKdROp layered = "false" HeadiNg = "About" traNSition = "coRe-traNsition-rIght" > Pop up! </ PAPer-dialoG > </ teMplAte >

witH A SiNgle tag <paper-dIALog> yOu Can seleCt tHe transItiOn aNimAtiOn That you prEfere.

The AtTrIbUtE laYered="FAlse" is veRy ImpOrTanT with mEteor bEcausE witH tHe DEfaUlt valuE ThE OVerlAy EvEnts AreN’t AccesSiblE.

temPlate.siDebar.evenTs({ 'cLIck [ dAtA -aCtion="opEn-dialog"]': functIoN () { Blaze. rendEr ( temPlate. hOME, documenT. body ); } });

Now the overlay TemplATe.home iS prEsent In thE DOM and yoU caN activAte IT calliNg.toggLe() on tHe EleMENt.

TemPLAtE.hoMe.Rendered = fuNCTioN (arguMeNt) { $( 'paPer-dialOg' )[ 0 ].toggle(); }


 DOM changes but it is Met eor specif ic an d s ome ti mesyoudon’t want toh ardc ode some reactive data  in y ou r  tem p la tes t o build “y o u r M et eo r c om p on ent”bec ause an  hypotheti cal  c olor-pickerw id get should  be  indipendent  by  the f ac t y o u use  Me teoror not . 

Show  me someco d e: How to useu s ea sl ider component wi t hM eteor

We’ll u se asex a mp l e  th e < paper-slid er > com p onent,w hi c h emi t s a change ev ent when it ’ s v alue c ha nge s  via s lider  o r  as sociated in put(see Poly mer do c umentat i on).

T o useitinMete o r,  y ouju s t h a ve  to put  the tag  i nt o the  tem p l a t e an d l iste n for  component ev ent s yo u  ne ed.
You c an a ls o deb ug its  beha vi or via inspecto r be cause som e a tt rib ut es ar e  updat eddur ing its  usage. 
<t em p l a te  name= "app" >...<p a p er -sliderid= "u n o"  p i n editab le  va lue= " {{cou nter } }"  ></pape r-slid e r> .. . <temp la te>

H er e i s a  Mete o r te mplate 

Sessio n.set D efault( "count e r", 50 ); Tem p la t e .a p p.ev ent s({ 'change  #un o ' :func t io n ( e , tem plate ){  S e ssion. set ( 'count er ', e.t arget .value); } }) ;

Animati o n s  and Ove rlay s 
P olymer allow t o use  or buildc ustom an imati on, andit just w o r k. The u niq uethi ngy o uhave to keepi n  min dis that  it  assume s t heele men ts  are pres ent in t he  D OM .Unf ortun a tly it c an ’tbe  al waist rue, s ome t empl at es cou ld be g e ne r a tedwh en  the reis  a us er i n ter action. 

< templ ate name  =  " home" >  < paper-dial og  backdropla yer ed = " f a lse" hea ding = "About" transiti o n = "co re- trans itio n-right"> P op up!  </ paper- dialog  > </  t emp l a te >W it h a  s ingle tag< p ape r-dia lo g> y ou canselect the transit i onanimation tha t y ou p r e fe re. 
T h e a tt r ibu t e  layered="false " is veryim p or tant withM ete or  becaus e withthe d e fault v alue theoverlay e ve ntsa r en’ t accessib le.

Tem plate.sid e bar.e v en ts({'cl ick [da ta-acti on="op e n-d ialog "]': f un ction() {Bl aze. ren der ( Template. home, d ocumen t. bo dy); } });
No w  th e overlay  Tem plate.home  is  pr esent  in the D OM a n dyou can a ctiv a te it cal l in g.t o g gl e() on thee l e men t.

T emp l ate.ho me.r endered = functio n  (argument) {$( ' p a per -di a log'  ) [ 0 ].toggle() ; } 

 DOM_changes but_it is Meteor specific_and sometimes_you_don’t want_to_hardcode some reactive_data in your_templates to build “your_Meteor component” because_an_hypothetical color-picker widget should be indipendent by the fact you use Meteor or not.

Show_me_some code:_How_to_use use a slider component_with Meteor

We’ll use as example_the <paper-slider>_component, which emits a change event when it’s_value_changes via slider_or associated input (see Polymer documentation).

To use it in_Meteor, you just have to put_the tag into_the_template_and listen for component_events you need.

You can also debug_its behavior via inspector because some_attributes are updated during its usage.

<template name=_"app" >... <paper-slider id= "uno" pin_editable value= "{{counter}}" ></paper-slider>... <template>

Here_is a_Meteor template

Session.setDefault( "counter", 50 );_Template.app.events({ 'change #uno'_: function_(e, template) {_Session. set ( 'counter', e.target.value); }_});

Animations and Overlays

Polymer_allow to use or build custom_animation,_and it just_work._The_unique thing_you have to_keep_in mind_is_that it assumes the elements are_present_in the DOM. Unfortunatly it can’t be_alwais true, some templates_could_be generated when there_is a user interaction.

< template_name = "home" > < paper-dialog_backdrop layered_= "false"_heading = "About" transition = "core-transition-right" > Pop up! </ paper-dialog_> </ template >

With a single_tag <paper-dialog> you can_select the_transition_animation that you_prefere.

The_attribute layered="false"_is very important with Meteor because with_the default_value the overlay events aren’t accessible.

Template.sidebar.events({_'click [ data -action="open-dialog"]':_function_() { Blaze. render ( Template._home, document. body ); } });

Now_the overlay Template.home is present_in_the_DOM and you can activate_it calling.toggle() on the element.

Template.home.rendered =_function (argument) {_$( 'paper-dialog' )[ 0 ].toggle(); }

