ng-bind not working in AngularJS 2

Last Reply one year ago By dharmendr

Posted one year ago

Hi all

below Code for get the value of field from The controller in HTML. but it  not working in HTML.

it is Working in the Controller.

<div>
    <md-list flex style="padding:0;" ms-scroll >
            <md-list-item class="md-3-line"  ng-repeat="user in response" ng-click="taskCtrl.showDetailView(user.Name)">
                <div class="md-list-item-text" layout="column">
                    <h3>{{user.Name}}</h3>
                    <p>{{user.Location}}</p>                
                </div>
                <div flex="65" ng-if="taskCtrl.showView"   ng-model="clickedname"   style="float:right;margin-right: 325px">
                    <h3>fdsfsdfd23</h3>
                    <p  ng-bind="clickedname"></p>
                </div>
            </md-list-item>
        </md-list>
</div>

IN contrroller

self.showDetailView = function (var1) {
     debugger;
    self.showView = true;
    clickedname = var1;
    alert(clickedname);
 };

clickedname is showing in controller.

<p ng-bind="clickedname"></p>

is not displaying.

Posted one year ago