Thursday, October 5, 2017

value of ng-repeat doesn’t appear in @Html.EditorFor MVC angularjs

Back-end: C# MVC5 EF6.13
Framework front-end : AngularJS v1.3.5
Visual studuio : 2013

I have a problem I want to fill @ Html.EditorFor of razor by directive ng_repeat angularjs, but there are any data after running the application,

Code Rezor

            @Html.LabelFor(model => model.Nom_CltOrigine, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                <div ng-repeat="p in ResponsePartenaire">                       
                        @Html.EditorFor(model => model.Nom_CltOrigine, new { ng_model= "p.Cd_Partenaire" })
                        @Html.ValidationMessageFor(model => model.Nom_CltOrigine)

                    </div>        
        </div>

Code Angularjs

app.controller('HomeCommande', function ($scope,$http) {
    var IdPartenaire = $scope.data;
    $scope.GetPartenaire = function (IdPartenaire) {

        $scope.ResponsePartenaire = null;
        $http.get("/CommandeClt/GetPartenaire?Id_CltOrigine=" + parseInt(IdPartenaire)).success(function (data) {
            $scope.ResponsePartenaire = data; 
        }).error(function(er)
        {
            console.log(er);
        });
}
});

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/05/value-of-ng-repeat-doesnt-appear-in-html-editorfor-mvc-angularjs/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment