user3024814 user3024814 - 6 months ago 35
AngularJS Question

Angular Material can't set md-card as an anchor

Is it possible to make the whole card a link in Angular material or is there another directive intended for this use case?

Answer

You can just put a ng-click on the card and perform your operation.Further you can style the card with hover effects to get the feel of a link.Like this :

HTML:

<md-card ng-click="cardSelected()" class="cardAsLink">
      ....
</md-card>

JS:

$scope.cardSelected=function(){
  console.log("card Clicked");
}

CSS:

.cardAsLink{
  cursor: pointer;
}

.cardAsLink:hover{
  border : 1px solid blue;
}