本文实例为大家分享了android九宫格图片展示的具体代码,供大家参考,具体内容如下
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>天气</title> <script src="../angular-1.5.5/angular.min.js"></script> <script> var u1="https://free-api.heweather.com/v5/weather?city="; var u2; var u3="&key=545d63e185fc48169a43cbabba6e74d2"; var my=angular.module("my",[]); my.controller("mys",function ($scope,$http) { $scope.city="beijing"; $scope.show=false; $scope.search=function () { u2=$scope.city; $scope.show=true; $http({ url:u1+u2+u3 }).then(function (data) { $scope.cityname=data.data.heweather5[0].basic.city; $scope.date=data.data.heweather5[0].daily_forecast[0].date; $scope.mtemp=data.data.heweather5[0].daily_forecast[0].tmp.max; $scope.xtemp=data.data.heweather5[0].daily_forecast[0].tmp.min; }) $scope.city=""; }; }) </script> </head> <body ng-app="my" ng-controller="mys"> <input type="text" ng-model="city"/><button ng-click="search()">点击查询</button> <ul ng-show="show"> <li>{{cityname}}</li> <li>{{date}}</li> <li>{{mtemp}}</li> <li>{{xtemp}}</li> </ul> </body> </html>
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。
如对本文有疑问, 点击进行留言回复!!
基于Angular 8和Bootstrap 4实现动态主题切换的示例代码
解决三元运算符 报错“SyntaxError: can''t assign to conditional expression”
解决angular 使用原生拖拽页面卡顿及表单控件输入延迟问题
使用 Angular RouteReuseStrategy 缓存(路由)组件的实例代码
分享Angular http interceptors 拦截器使用(推荐)
网友评论