angular - Non-singleton services -


i have file upload component i'm using several times in 1 view. have service manages metadata each uploading file. when add files 1 component, components start updating instead of 1 had files added.

is there way have new instance of service attached each component being displayed?

according the docs:

providing service @ component level ensures every instance of component gets own, private instance of service.

so rather listing service in providers of application module, try listing in lower-level component definition.


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -