Angular JS $ http.get()

时间:2018-06-09 07:48:14

标签: angularjs angular-http

对于下面给出的代码,我没有得到输出

<div ng-app="myApp" ng-controller="mCtr">
    <p>{{content}}</p>
</div>
<script>
    var app = angular.module('myApp',[]);
    app.controller('mCtr',function($scope,$http)
    {
        $http.get("welcome.html").then(function(response)
        {
            $scope.content = response.data;
        });
    });
</script>

我正在获得这样的输出

<!DOCTYPE html> 
<html> 
  <head>
    <title>AJS Services HTTP</title>
    <script src="js/angular.min.js"></script>
  </head>
  <body>
    <p>Welcome to world of AJS</p>
    <h1>AJS means Angular JS</h1>
  </body>
</html>

0 个答案:

没有答案