You must Sign In to post a response.
  • Category: JQuery

    Binding dropdown using angularjs in aspx page, issue in form submit code

    Hi,
    I am using angular js to bind data in aspx page which contains so many js files already.
    After my first line of code ( var app = angular.module('MyApp', [])) its directly going to below script and exits from there.

    <script type="text/javascript">
    //<![CDATA[

    theForm.oldSubmit = theForm.submit;
    theForm.submit = WebForm_SaveScrollPositionSubmit;

    How to reslove this issue. Any help is greatly appreciated.

    Regards,
    Naresh.
  • #767957
    Hi Naresh,

    Have you called the Body with the same name 'MyApp'?
    Or you calling the controller with the same name,



    // module
    var personApp = angular.module('MyApp', []);

    // controller
    personApp.controller('MyApp', function ($scope) {
    $scope.firstName = "Mary";
    $scope.lastName = "Jane"
    });



    Kindly if possible post the code completely.

    Thanks,
    Mani

  • #767958
    Using controller i am binding. pls find the below complete code.
    <script type="text/javascript">
    var app = angular.module('MyApp', [])
    app.controller('MyController', function ($scope, $window) {
    $scope.Fruits = [{
    Id: 1,
    Name: 'Apple'
    }, {
    Id: 2,
    Name: 'Mango'
    }, {
    Id: 3,
    Name: 'Orange'
    }];
    });


    </script>

    <div ng-app="MyApp" ng-controller="MyController">
    <select ng-model="ddlFruits" ng-options="fruit.Name for fruit in Fruits track by fruit.Id">
    </select>
    </div>


  • Sign In to post your comments