第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

angular2中怎么請求數(shù)據(jù)

angular2中怎么請求數(shù)據(jù)

qq_遁去的一_1 2019-03-08 09:06:59
angular2中怎么請求數(shù)據(jù)
查看完整描述

2 回答

?
湖上湖

TA貢獻(xiàn)2003條經(jīng)驗 獲得超2個贊

AngularJS提供$http控制,可以作為一項服務(wù)從服務(wù)器讀取數(shù)據(jù)。服務(wù)器可以使一個數(shù)據(jù)庫調(diào)用來獲取記錄。 AngularJS需要JSON格式的數(shù)據(jù)。一旦數(shù)據(jù)準(zhǔn)備好,$http可以用以下面的方式從服務(wù)器得到數(shù)據(jù)。
function studentController($scope,$http) {
var url="data.txt";
$http.get(url).success( function(response) {
$scope.students = response;
});

查看完整回答
反對 回復(fù) 2019-03-16
?
一只甜甜圈

TA貢獻(xiàn)1836條經(jīng)驗 獲得超5個贊



1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

<html>

<head>

<title>AngularJs Demo</title>

<script type='text/javascript' src="./angular.min.js"></script>

</head>

<body ng-app="myApp">

<h1>AngularJs Demo</h1>

<div ng-cloak ng-controller="DemoCtrl" ng-init="pageInit()">{{hello}}</div>

<script type='text/javascript'>

var app = angular.module('myApp', []);

app.controller('DemoCtrl', function($scope) {

  $scope.pageInit = function() {

    $scope.hello = 'Hello AngularJs';

  }

});

</script>

</body>

</html>

保存為html, 當(dāng)前目錄需要angular.min.js文件.

 


查看完整回答
反對 回復(fù) 2019-03-16
  • 2 回答
  • 0 關(guān)注
  • 656 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號