Implmenting onData in 'dart:html' dispatchEvent -
I am developing an application but I have noticed that under the addRace method in class there is very similar code of each class below : I tried to move the repetitive code to the library, which was shared with the following refactoring: However, the DART IDE Dispatch Filters the Ident Method flagged in the Adform method because the data on the parameters (dynamic) -> Zero. Given that Dispatch Event is in 'Dart: HTML' package. I do uncertain that further thanks for any help. I did not find any You can apply it as a mixer so that it can be easier to reuse. For example (see @CustomTag ('race-view') extends the class race vaporum polymer element {Race-Viewformatted (): Super. Created (); Zero addRace (Event e, Miscellaneous details, element target) {var raceElem = $ ['race']; If (raceElem.children.length & lt; 1) {raceElem.children.add (New Element.tag ('race-form')); } raceElem.on [DELETE_BUTTON_FORM_EVENT] .listen {(e.target as Element) .remove (); Dispatches (new custom event (RACE_VIEW_EVENT, extension: new race))}};}} < / code>
import 'dart: html'; import 'package: inspection / inspection' dart '; ... zero addForm (element target, string event name, string dispatch A Nant, dynamic installation) {var element = target; if (element.children.length & lt; 1) {element.children.add (New Element.tag);} element.on [eventName ] .listen (e.target as element) ({e.target as element) .remove (); Dispatches (new custom event (sending event name, extension: example));})}}
sender () in
dart: html (top level) As a method of the only
node class you have to pass your polymer element in the library method.
expandable ,
customizeable ).
Comments
Post a Comment