Click here to Skip to main content
16,020,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

C#
<button class="btn btn-default" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{Roles}}
<img src="images/user-pic.png" ng-attr-src="{{'images/'+profilepic}}"  alt="user">
                    </button>



And My Js Code Like This

PHP
$scope.init = function () {
       // check if there is query in url
       // and fire search in case its value is not empty
       $http.get("api/Login/Getusername")
      .success(function (data, status, headers, config) {
          if (data != "") {
              debugger;
              $scope.Employees = data;
              $scope.User = data[0].username;
              $scope.Roles = data[0].RoleName;
              $scope.profilepic = data[0].profilepic;
              $scope.LoginTime = data[0].SessionInTime;
          }
          else if (data === null | data == "") {
              window.location.href = "Login";
          }

      });
   };



I want to Display Image at Image COntrol
Posted

1 solution

C#
<button class="btn btn-default" id="dLabel" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{Roles}}
<img ng-attr-src="{{'images/'+profilepic}}" alt="user">
                    </button></img></button>


I Just Remove ng-src extra tag..Then automatically image was displayed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900