dart - How to get a reference to a particular component in an Angular2 template -


i know angular2 has @viewquery querylist of components matching given type. there way reference particular component in querylist?

right now, way can think give component "id" field, iterate through querylist , check if identifier 1 want, e.g.:

getcomponentbyid(querylist<hasidfield> querylist, string id) =>     querylist.singlewhere((component) => component.id == id); 

but seems common enough problem seems there should way without adding "id" boilerplate. know component can referenced locally within template using #, there way reference component within class?

currently functionality not exist, see here details on why functionality implement custom filter on hold due potential performance reasons.

so way doing seems right way given functionality available currently, might change framework in alpha.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -