without knowing the values of all of the items that you are selecting via
jquery, it is near impossible to know what is happening. Plus, you say
'when it returns' - the function doesn't actually return anything. Maybe
make a more concise example, or a plunker

On 17 November 2014 15:59, Mike Wassermann <[email protected]> wrote:

>
> When *I envoke *$scope.idLND_UpdateLender_click for a non-biz entity, when it 
> returns I get a prop = (0) error, everytime
> don't know what to do or the cause.
>
> (function () {
>     'use strict';
>     var controllerId = 'dashboard';
>
>     angular.module('app').controller(controllerId, ['common', 'datacontext', 
> '$scope', '$http', dashboard]);
>
>     function dashboard(common, datacontext, $scope, $http) {
>         var getLogFn = common.logger.getLogFn;
>         var log = getLogFn(controllerId);
>         var vm = this;
>
>         vm.news = {
>             title: 'Stewart Title Company',
>             description: 'Stewart Title Company, Order Entry application.'
>         };
>
>         var today = new Date();
>         var dd = today.getDate();
>         var mm = today.getMonth() + 1; //January is 0!
>         var yyyy = today.getFullYear();
>
>         if (dd < 10) {
>             dd = '0' + dd
>         }
>
>         if (mm < 10) {
>             mm = '0' + mm
>         }
>
>         today = mm + '/' + dd + '/' + yyyy;
>
>         vm.messageCount = 0; //Mozart
>         vm.people = [];
>         vm.title = 'Dashboard';
>         vm.toDay = today;
>         vm.orderEntry;
>         vm.model = { LenderCount: 0, Lenders: Array };
>
>         $scope.isBussiness = true;
>         $scope.notBiz = false;
>         $scope.isValid = true;
>         $scope.title = 'LendersOptionsCtrl';
>
>         $scope.idLND_AddLender_click = function (vm) {
>             $scope.safeApply(function () {
>                 var OptName = "Mortgage";
>                 var options = $('#idLND_MortgageSel')[0].options;
>                 vm.model.LenderCount = $('#idLND_MortgageSel')[0].length;
>
>                 if (options == undefined) {
>                     OptName = "Mortgage " + vm.model.LenderCount.toString();
>                 }
>                 else {
>                     vm.model.LenderCount = vm.model.LenderCount + 1;
>                     OptName = "Mortgage " + vm.model.LenderCount.toString();
>                 }
>
>                 if (vm.model.LenderCount >= 0 && vm.model.LenderCount <= 4) {
>                     $('#idLND_MortgageSel').append(new Option(OptName, 
> vm.model.LenderCount, true, true));
>                 }
>
>                 var elems = document.getElementsByTagName("input");
>                 var l = elems.length;
>                 for (var i = 0; i < l; ++i) {
>                     elems[i].value = "";
>                 }
>             });
>         };
>
>         $scope.idLND_DeleteLender_click = function () {
>             $scope.safeApply(function () {
>                 var elems = document.getElementsByTagName("input");
>                 var l = elems.length;
>                 for (var i = 0; i < l; ++i) {
>                     elems[i].value = "";
>                 }
>
>                 var options = $('#idLND_LendersSel')[0].options;
>                 options.remove("selected");
>             });
>         };
>
>         $scope.idLND_UpdateLender_click = function (vm) {
>             $scope.$evalAsync(function () {
>                 if ($("#idPBB_BusinessCheckbox").ckecked) {
>                     alert("update biz");
>
>                     var isBiz = true;
>                     var iobj = new BizMortgage($("#idLND_LenderType").val(),
>                     isBiz,
>                     $("#idLND_MortgageSel").val(),
>                     $("#idLND_BusinessName").val(),
>                     $("#idLND_TaxID").val(),
>                     $("#idLND_Address1").val(),
>                     $("#idLND_Address2").val(),
>                     $("#idLND_City").val(),
>                     $("#idLND_State").val(),
>                     $("#idLND_Zip").val(),
>                     $("#idLND_County").val(),
>                     $("#idLND_EMail").val(),
>                     $("#idLND_HomePhone").val(),
>                     $("#idLND_HomePhoneExtension").val(),
>                     $("#idLND_MobilePhone").val(),
>
>                     $("#idLND_NBPrefix").val(),
>                     $("#idLND_NBFirst").val(),
>                     $("#idLND_NBMiddle").val(),
>                     $("#idLND_NBLast").val(),
>                     $("#idLND_NBSuffix").val(),
>
>                     $("#idLND_EstSettlementDate").val(),
>                     $("#idLND_LoanAmount").val(),
>                     $("#idLND_LoanAmount").val(),
>                     $("#idLND_LoanType").val(),
>
>                     $("#idLND_BCPrefix").val(),
>                     $("#idLND_BCFirst").val(),
>                     $("#idLND_BCMiddle").val(),
>                     $("#idLND_BCLast").val(),
>
>                     $("#idLND_BCSuffix").val(),
>                     $("#idLND_BCBusinessPhone").val(),
>                     $("#idLND_BCBusinessExtension").val(),
>                     $("#idLND_BCBusinessFax").val());
>
>                     if (vm.model.LenderCount == 0) {
>                         iobj.mortgage = 1;
>                         vm.model.add(vm, iobj);
>                         vm.model.LenderCount = vm.model.LenderCount + 1;
>                     }
>
>                     if (iobj.mortgage == '' && 
> vm.model.Lenders.prototype.length < 4) {
>                         vm.model.LenderCount = vm.model.LenderCount + 1;
>                         iobj.mortgage = vm.model.LenderCount;
>                         vm.model.add(vm, iobj);
>                     }
>
>                     if (iobj.mortgage != '' && 
> vm.model.Lenders.prototype.length == 3) {
>                         //update
>                         vm.model.Lenders[iobj.mortgage] = iobj;
>                     }
>                 }
>                 else {
>
>                     var isBiz = false;
>                     var iobj = new IndMortgage($("#idLND_LenderType").val(),
>                     isBiz,
>                     $("#idLND_MortgageSel").val(),
>                     $("#idLND_NBPrefix").val(),
>                     $("#idLND_NBFirst").val(),
>                     $("#idLND_NBMiddle").val(),
>                     $("#idLND_NBLast").val(),
>                     $("#idLND_NBSuffix").val(),
>                     $("#idLND_Address1").val(),
>                     $("#idLND_Address2").val(),
>                     $("#idLND_NBCity").val(),
>                     $("#idLND_NBState").val(),
>                     $("#idLND_NBZip").val(),
>                     $("#idLND_NBCounty").val(),
>                     $("#idLND_NBEMail").val(),
>                     $("#idLND_NBHomePhone").val(),
>                     $("#idLND_NBHomePhoneExtension").val(),
>                     $("#idLND_NBMobilePhone").val(),
>                     $("#idLND_EstSettlementDate-X").val(),
>                     $("#idLND_LoanAmount").val(),
>                     $("#idLND_LoanAmount").val(),
>                     $("#idLND_LoanType").val());
>
>                     if (vm.model.LenderCount == 0) {
>                         iobj.mortgage = 1;
>                         vm.model.add(vm, iobj);
>                         //vm.model.LenderCount = vm.model.LenderCount + 1;
>                     }
>
>                     if (iobj.mortgage == '-1' && 
> vm.model.Lenders.prototype.length < 4) {
>                         //vm.model.LenderCount = vm.model.LenderCount + 1;
>                         iobj.mortgage = vm.model.LenderCount;
>                         vm.model.add(vm, iobj);
>                     }
>
>                     if (iobj.mortgage != '' && 
> vm.model.Lenders.prototype.length == 3) {
>                         //update
>                         vm.model.Lenders[iobj.mortgage] = iobj;
>                     }
>                 }
>             });
>         };
>
>  --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Tony Polinelli

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to