angular 急速入门 , 显示视图, 外加: 发起请求到后台。

访问量: 322

demo: 具体见官方的例子。 

angular.module('todoApp',[])
.controller('TodoListController', function($scope, $http){
  var todoList = this;
  //todoList.todos = [
  //  {text:'learn angular', done:true},
  //  {text:'build an  angular app', done:false}
  //];
  $http.get('http://localhost:3000/todos/list').
    then(function(response){
      console.info("== before send get request");
      todoList.todos = response.data
      console.info("== after send get request");
      console.response.data;
    });

订阅/RSS Feed

Subscribe

分类/category