mercredi 15 novembre 2017

How to add content to ember component dynamically

I am writing a web application in ember.js for the first time. I'm using ember-leaflet in order to create a map, which is the main page of the application. The map is located in a component called main-map and looks like:



  
    
      
    
  

  
    
      
    
  

  


This main-map component is located in my application.hbs so it is present in all routes in my website. In one route that I have, called search-address, I need to add a marker to the map based on the user input. The marker will look something like:


   
     <h4> My address </h4>
   
 

I need a way to modify the main-map from within my search-address.js file in order to add these markers to my map. How can I accomplish this in Ember?




Aucun commentaire:

Enregistrer un commentaire