I got TypeError: this.service is not a constructor
When I tried to click save button , it will trigger $scope.updateBank, then Bank.prototype.update method

update function in controller
$scope.updateBank = $scope.BankService.update;
Create Bank CRUD service
I also tried .service, it still not works.
angular.module('bank', [])
    .factory('bankService', function($resource, $http) { // I also tried .service, it still not works.
        var Bank;
        return Bank = (function() {
            function Bank(BankListId, errorHandler) {
                var defaults;
                // http://dev.co
                this.service = $resource('/api/v1/banks/:id', {
                    id: '@id'
                }, {
                    update: {
                        method: 'PUT'
                    }
                });
                this.errorHandler = errorHandler;
            }
        Bank.prototype.update = function(bank, bank_id) {
            console.log(bank) // Object {name: "Simonis Inc!!"}
            console.log(bank_id) // 101
            return new this.service({
                Bank: bank
            }).$update({
                id: bank_id
            }, (function() {
                return null;
            }), this.errorHandler);
        };
        // the query all function works perfectly.
        Bank.prototype.all = function() {
            return this.service.query((function() {
                return null;
            }), this.errorHandler).$promise;
        };
Update
banks_controller
$q.all([this.BankService.all().$promise]).then(function(ret){
  $scope.banks = ret[0]
  console.log($scope.banks)
});
$scope.updateBank = this.BankService.update;
REST service
        Bank.prototype.update = function(bank, bank_id) {
            # here, `this` is the banks_controller
        };
        // the query all function works perfectly.
        Bank.prototype.all = function() {
            # `this` is the Bank
        };
 
    