I have a jsp page and i use AngularJs to loop and populate the page
<div ng-repeat="w in weatherData track by $index"
ng-click="displayWeatherDetail(w.name)"
class="col-md-4 col-sm-6 portfolio-item ">
<div class="card portfolio-link ">
<a class="portfolio-link" data-toggle="modal"
href="#portfolioModal6">
<div class="portfolio-hover">
<div class="portfolio-hover-content">
<i class="fa fa-plus fa-3x"></i>
</div>
</div> <img class="img-fluid"
src="resources/img/portfolio/06-thumbnail.jpg" alt="City image">
</a>
<div class="card-body">
<h3 id="test" class="card-title">{{w.name}}</h3>
<p class="card-text ">
{{w.description}} <span><img src="{{w.icon}}" /></span>
</p>
<p class="card-text text-muted">
Maxumum Temprature: {{w.temp}} ° C <br> Minimum
Temprature: {{w.minTemp}} ° C <br> Humidity:
{{w.humidity}} ° C
</p>
</div>
</div>
</div>
With jquery i want to retrieve the H3 element inside the card-body
element with this code:
$(document).ready(function(){
alert($("#test").val());
});
I get as result undefined. If i try with text()
i get empty text. Seems like that jquery runs before angularJs finish to populate the view. What i'm trying to accomplish is. I got a lot of city to display, angular take city names and information from my server, with the city name i want to contact google image api to retrieve an image of that city and add it an image inside the previous generated card.