javascript - Angular Image Conditions -


Actually what I am currently doing is calling a jsonp array, which has an image URL for the icon Works well and displays what I want to do except for the icons. I have replaced the icons with my own but the problem is that they are dynamic as a weather API, so when the icon changes, the icon link Will change on different icons. What can I get from JSN to the weather conditions like partly cloudy and use it to call a specific IMG? How would I go about this in angle angle?

  var app = angular Module ('app'); App.controller ('MainCtrl', function ($ radius, $ http) {$ http.jsonp ('http://api.wunderground.com/api/5ad0204df4bdbeff/conditions/q/Australia/Melbourne.json?callback=JSON_CALLBACK ') .vivet (data) {$ scope.currentMelbourne = data;}); $ http.jsonp (' http://api.wunderground.com/api/5ad0204df4bdbeff/conditions/q/Australia/Sydney.json? Callback = JSON_CALLBACK '). Success (Tasks (data) {$ scope.currentSydney = data;}); $ http.jsonp (' http://api.wunderground.com/api/5ad0204df4bdbeff/conditions/q/Australia/Adelaide .json? Callback = JSON_CALLBACK '). Success (function (data) {$ scope.currentAdelaide = data;}); $ http.jsonp (' http://api.wunderground.com/api/5ad0204df4bdbeff/conditions/q/ Australia / Darwin.Jason? Callback = JSONclub '). (Work (data) {$ scope.currentDarwin = data;}); $ http.jsonp ('http://api.wunderground.com/api/5ad0204df4bdbeff/conditions Success (work (data) {$ scope.currentPerth = Data;}); $ http.jsonp ('http://api.wunderground.com/api/5ad0204df 4bdbeff / conditions / q / Australia / Cairns.json? Callback = JSON_CALLBACK '). Success (data) {$ scope.currentCairns = data;}); $ Http.jsonp ('http://api.wunderground.com/api/5ad0204df4bdbeff/conditions/q/Australia/Brisbane.json?callback=JSON_CALLBACK') .Vivet (function) {$ scope.currentBrisbane = data; $ Scope.cityData = [{Name: 'Brisbane', Temporary: $ scope.currentBrisbane.current_observation.temp_c, Image: $ scope.currentBrisbane.current_observation.icon}, {Name: 'Melbourne', Temporary: $ scope.currentMelbourne Current_observation .temp_c, image: $ scope.currentMelbourne.current_observation.icon}, {name: 'adelaide', temporary: $ scope.currentAdelaide.current_observation.temp_c, image: $ scope.currentAdelaide.current_observation.icon}, {name: Darwin ' , Temporary: $ scope.currentDarwin.current_observation.temp_c, Image: $ scope.currentDarwin.current_observation.icon}, {name: 'Perth', Temporary: $ scope.cu RrentPerth.current_observation.temp_c, image: $ scope.currentPerth .current_observation.icon}, {name: 'Cairns', temporary: $ scope.currentCairns.current_observation.temp_c, image: $ scope.currentCairns.current_observation.icon},]} ); });   

here is html

  & lt; Div id = "weather-container" & gt; & Lt; div id = "current-weather" & gt; & Lt ;! - angular json bridge - & gt; & Lt; Div id = "title" & gt; & Lt; span id = "current-title" & gt; Current season & lt; / Span & gt; & Lt; / Div & gt; & Lt; div id = "current state" & gt; {{currentSydney.current_observation.weather}} & lt; / Div & gt; & Lt ;! - Image object here - & gt; & Lt; Img ng-src = "{{currentSydney.current_observation.icon_url}}" & gt; & Lt; / Img & gt; & Lt; Div id = "current-provisional" & gt; & Lt; Span id = "current-temp" & gt; {{currentSydney.current_observation.temp_c}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; span id = "current-city" & gt; {{currentSydney.current_observation.display_location.city}} & lt; / Span & gt; & Lt; / Div & gt; & Lt ;! - Angular JSON Bridge and Recurrence - & gt; & Lt; Div id = "other city-container" & gt; & Lt; Div square = "other-city-weather" ng-repeat = "city data in city" & gt; & Lt ;! - Image object here - & gt; & Lt; Img ng-src = "{{city.image}}" & gt; & Lt; / Img & gt; & Lt; Div class = "current-city-temporal" & gt; & Lt; Period & gt; {{City.temp}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; Div square = "current-city-bottom" & gt; & Lt; Period & gt; In the {{city.name}} & lt; / Span & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;    

You can type a helper function After every jjax request is successful, the URL property in your JSR Please provide more information, so we can assist you.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -