I am trying to pass two different parameter to isolated scope inside directive.When I log out values in console then for collapse I am getting true but for infoCard I am getting false value.My question is why I am getting false value for infoCard Thanks in advance.Here is my directive.
<display-info user="user" collapse="true" infoCard="true"></display- info> In my controller i am receiving the parameter,
angular.module('myApp').directive('displayInfo', function() { return { templateUrl: "displayInfo.html", restrict: "EA", scope: { user: '=', initialCollapse:'@collapse', showInfo:'@infoCard' }, controller: function($scope) { $scope.collapse = ($scope.initialCollapse === 'true'); $scope.infoCard = ($scope.showInfo === 'true'); console.log("collapse---->",$scope.collapse); console.log("displyInfo---->",$scope.infoCard); } } }); Here is plunker link https://plnkr.co/edit/Gng7e4RRVvg8wPOnqQrk?p=preview