Cordova学习笔记 http及run方法
admin
2023-07-31 14:23:19
0



    
    
    test


    
        
            name:          
        
        `name`                       `sex`,`age`         
        
            `sex`,`age`         
        
          `person`.`name` ; {{number[0]}}+6={{5+6}},{{'对'+'的'+age}}          
                     title:             `title`         
                     
                                          `n`                              
        
        `testdata`     
                  var myApp = angular.module('myApp', []);         myApp.controller('firstCtl', function($scope) { //控制器的 $scope 是控制器所指向的应用程序 HTML 元素 angular 中$scope 是连接 controllers(控制器)和 templates(模板 view/视图)的主要胶合体。             $scope.title = 'Hello';         });         myApp.run(['$rootScope',function($rootScope){ //只对全局作用域起作用             $rootScope.testdata = 'heheh';         }]);         myApp.controller('secondCtl', function($scope , $http) {             $scope.numbs  = [111,222,333,444];             $http({                 method: 'GET',                 url: 'http://www.test.com/test2.php'             }).then(function successCallback(response) {                 /*                  response这个对象有如下属性:                  data – {string|Object} – 服务器返回的数据                  status – {number} – 响应的 HTTP 状态码 .                  headers – {function([headerName])} – Header getter function.                  config – {Object} – The configuration object that was used to generate the request.                  statusText – {string} – 响应的 HTTP 状态文件本.                  */                 console.log(response);             }, function errorCallback(response) {                 console.log(response);             });             $http({                 method: 'POST',                 url: 'http://www.test.com/test2.php',                 data:"test=test22222",                 headers: {                     'Content-Type': 'application/x-www-form-urlencoded'                 },             }).then(function successCB(response){                 console.log(response);             },function errorCB(response){                 console.log(response);             });             $http.post('http://www.test.com/test2.php',                     {'test':'po'},                     {params:{'te':'te'}}).then(function(response){                 console.log(response);             },function(response){                 console.log(response);             });         });     


相关内容

热门资讯

伊朗严正警告美国 伊朗外交部副部长加里巴巴迪当地时间8日在社交媒体上表示,美国取消对伊朗石油销售制裁的豁免,构成对美伊...
四川宜宾市发生5.0级地震,震... 中国地震台网正式测定:7月8日6时12分,在四川宜宾市高县(北纬28.52度,东经104.68度)发...
美军发动打击,伊朗多地传出爆炸... 当地时间今天(7月8日)凌晨,伊朗南部格什姆岛及锡里克、阿巴斯港等多地传出爆炸声。据伊朗媒体报道,锡...
瀚云通取得运动型线缆保护拖链专... 国家知识产权局信息显示,深圳市瀚云通科技有限公司取得一项名为“一种运动型线缆的保护拖链”的专利,授权...
第六届成渝双城青少年科技雏鹰研... 人民网重庆7月7日电 (记者胡虹)7月6日,由重庆市科协和成都市科协联合主办的第六届成渝双城青少年科...
三星Galaxy F70 Pr... IT之家 7 月 7 日消息,消息源 Mohammed Khatri 发文,透露三星旗下一款 Gal...
央媒关注!成都太空算力加速布局 7月6日,经济日报发布文章《太空算力加速布局》,其中关注成都构建从卫星制造到算力服务的全链条产业体系...
投资中国,与未来共舞——202... 7月8日下午,一场汇聚顶级资本力量与硬核科技创新力量的盛会——2026新京报贝壳财经年会未来大会 “...
美国恢复对伊朗石油制裁 根据美国财政部外国资产控制办公室当地时间7月7日消息,美国撤销一项授权允许伊朗石油销售的通用许可,相...
暗示要对梅洛尼下达限制令后,特... 当地时间7月7日,正在土耳其参加北约峰会的美国总统特朗普称意大利总理梅洛尼是“好人”,尽管他上周末曾...