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 : @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>

I tried to move the repetitive code to the library, which was shared with the following refactoring:

  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));})}}   

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 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.

You can apply it as a mixer so that it can be easier to reuse. For example (see expandable , customizeable ).

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -