javascript常用知识点:
http://www.cnblogs.com/pingfan1990/p/4309223.html
Function.prototype.bind()
Function.prototype.call()
Function.prototype.apply()
call and apply call a function while bind creates a function. Though with call()
you pass arguments individually and apply()
as an argument array.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
var app = angular.module("Demo", ["ngRoute"]) .config(function ($routeProvider, $locationProvider) { $routeProvider .when("/home", { templateUrl: "Templates/home.html", controller: "homeController" }) .when("/courses", { templateUrl: "Templates/courses.html", controller: "coursesController" }) .when("/students", { templateUrl: "Templates/students.html", controller: "studentsController" }) .otherwise({ redirectTo: "/home" }); $locationProvider.html5Mode(true); }) .constroller("homeController", function ($scope) { $scope.messsage = "Home Page"; }) .constroller("coursesController", function ($scope) { $scope.courses = ["C#", "VB.NET"]; }) .constroller("studentsController", function ($scope, $http) { $http.get("StudentService.asmx/GetAllStudents") .then(function (response) { $scope.students = response.data; }); });