我不确定为什么这个客户数据不更新 shoppingCart.html 模板,这个函数是工厂返回的共享模型类的一部分。
$http 已注入,但模型类无法在承诺结果中自行更新。所以模板终于更新了。最好的方法是什么?
http://plnkr.co/edit/ro6FTa5AbhnzrMsnWIyi?p=preview
    shoppingCart.prototype.fillCustomerInformation = function()
    {
        var customerDeferred = this.$q.defer();
        var customerApi = customerDeferred.promise;
        this.$http.get('/customer.json').then(function (result) {
            customerDeferred.resolve(result.data);
            console.log(result.data);
            this.customer.firstName = result.data.firstName;
            this.saveItems()
        });
     }