养成前端、后端Debug的良好习惯

1.1 前端debug

/**定义基础控制器*/
app.controller('baseController',function ($scope,$http) {
    /**获取登录用户名方法*/
    $scope.loadUsername = function () {
        /**定义重定向URL*/
        $scope.redirectUrl = window.encodeURIComponent(location.href);
        /**获取登录用户名*/
        $http.get("/user/showName").then(function (response) {
            debugger;
             $scope.loginName = response.data.loginName;
        });
    };
});
  • 可以在页面上直接写上 debugger;也可以直接在浏览器打断点。

猜你喜欢

转载自blog.csdn.net/Huangyuhua068/article/details/85028687