我需要在某些页面上显示某些内容,在其他页面中它不应该是可见的.我该如何实现?它不起作用
*ngIf="[routerLink]="['/home']"
我一直在我的项目中使用纯css翻转卡,但这个解决方案不合适.点击一个按钮,有人可以在角度2翻转吗?我在angularjs https://codepen.io/Zbeyer/pen/oXQrZg中找到了一个
<div ng-app="cardFlipper" ng-controller="AppController">
<h1>Card Flipping AngularJS</h1>
<div class="flip-container">
<div class="flipper" ng-click="flipCard()" ng-class="{'flipToFront':isCardRevealed, 'flipToBack':!isCardRevealed}">
<div class="back" ng-class="{'face-hidden':hideBackFace}">
</div>
<div class="front" ng-class="{'face-hidden':!hideBackFace}">
<h1>{{currentCard.title | uppercase}}</h1>
<p ng-if="currentCard.icon">{{currentCard.icon}}</p>
<br ng-if="currentCard.icon" />
<img ng-if="currentCard.imageUrl" src="{{currentCard.imageUrl}}" alt="currentCard.imageAlt" />
<p>{{currentCard.description}}</p>
</div>
</div>
</div>
<footer>
<div ng-if="currentCard && currentCard.source">
<a ng-href="{{currentCard.source}}" target="_blank">Source</a>
</div>
</footer>
<br />
<br />
</div>
<style>
/* CARD DIMENSIONS */
@width: 19em;
@height: 27em;
@shadow:1em 1em 2em #111111;
/* MIXINS */
.box-shadow (@string:@shadow) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string; …Run Code Online (Sandbox Code Playgroud) 我这里有一个工具提示代码。当我在此工具提示上移动鼠标以单击按钮时,它就会消失。怎么让它留下来?我不知道怎么做
a.tooltips {
position: relative;
}
a.tooltips span {
position: absolute;
width: 140px;
color: #FFFFFF;
background: #000000;
min-height: 50px;
line-height: 30px;
text-align: center;
visibility: hidden;
border-radius: 6px;
}
a.tooltips span:after {
content: '';
position: absolute;
top: 100%;
left: 50%;
margin-left: -8px;
width: 0;
height: 0;
border-top: 8px solid #000000;
border-right: 8px solid transparent;
border-left: 8px solid transparent;
}
a:hover.tooltips span {
visibility: visible;
opacity: 0.8;
bottom: 30px;
left: 50%;
margin-left: -76px;
z-index: 999;
}Run Code Online (Sandbox Code Playgroud)
<a class="tooltips" href="#">CSS Tooltips
<span>Tooltip <button …Run Code Online (Sandbox Code Playgroud)