亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

annuaire recherche
AngularJS API Reference auto auto/service auto/service/$injector auto/service/$provide ng ng/directive ng/directive/a ng/directive/form ng/directive/input ng/directive/input[checkbox] ng/directive/input[date] ng/directive/input[dateTimeLocal] ng/directive/input[email] ng/directive/input[month] ng/directive/input[number] ng/directive/input[radio] ng/directive/input[text] ng/directive/input[time] ng/directive/input[url] ng/directive/input[week] ng/directive/ngApp ng/directive/ngBind ng/directive/ngBindHtml ng/directive/ngBindTemplate ng/directive/ngBlur ng/directive/ngChange ng/directive/ngChecked ng/directive/ngClass ng/directive/ngClassEven ng/directive/ngClassOdd ng/directive/ngClick ng/directive/ngCloak ng/directive/ngController ng/directive/ngCopy ng/directive/ngCsp ng/directive/ngCut ng/directive/ngDblclick ng/directive/ngDisabled ng/directive/ngFocus ng/directive/ngForm ng/directive/ngHide ng/directive/ngHref ng/directive/ngIf ng/directive/ngInclude ng/directive/ngInit ng/directive/ngKeydown ng/directive/ngKeypress ng/directive/ngKeyup ng/directive/ngList ng/directive/ngModel ng/directive/ngModelOptions ng/directive/ngMousedown ng/directive/ngMouseenter ng/directive/ngMouseleave ng/directive/ngMousemove ng/directive/ngMouseover ng/directive/ngMouseup ng/directive/ngNonBindable ng/directive/ngOpen ng/directive/ngPaste ng/directive/ngPluralize ng/directive/ngReadonly ng/directive/ngRepeat ng/directive/ngSelected ng/directive/ngShow ng/directive/ngSrc ng/directive/ngSrcset ng/directive/ngStyle ng/directive/ngSubmit ng/directive/ngSwitch ng/directive/ngTransclude ng/directive/ngValue ng/directive/script ng/directive/select ng/directive/textarea ng/filter ng/filter/currency ng/filter/date ng/filter/filter ng/filter/json ng/filter/limitTo ng/filter/lowercase ng/filter/number ng/filter/orderBy ng/filter/uppercase ng/function ng/function/angular.bind ng/function/angular.bootstrap ng/function/angular.copy ng/function/angular.element ng/function/angular.equals ng/function/angular.extend ng/function/angular.forEach ng/function/angular.fromJson ng/function/angular.identity ng/function/angular.injector ng/function/angular.isArray ng/function/angular.isDate ng/function/angular.isDefined ng/function/angular.isElement ng/function/angular.isFunction ng/function/angular.isNumber ng/function/angular.isObject ng/function/angular.isString ng/function/angular.isUndefined ng/function/angular.lowercase ng/function/angular.module ng/function/angular.noop ng/function/angular.toJson ng/function/angular.uppercase ng/object ng/object/angular.version ng/provider ng/provider/$animateProvider ng/provider/$compileProvider ng/provider/$controllerProvider ng/provider/$filterProvider ng/provider/$httpProvider ng/provider/$interpolateProvider ng/provider/$locationProvider ng/provider/$logProvider ng/provider/$parseProvider ng/provider/$rootScopeProvider ng/provider/$sceDelegateProvider ng/provider/$sceProvider ng/service ng/service/$anchorScroll ng/service/$animate ng/service/$cacheFactory ng/service/$compile ng/service/$controller ng/service/$document ng/service/$exceptionHandler ng/service/$filter ng/service/$http ng/service/$httpBackend ng/service/$interpolate ng/service/$interval ng/service/$locale ng/service/$location ng/service/$log ng/service/$parse ng/service/$q ng/service/$rootElement ng/service/$rootScope ng/service/$sce ng/service/$sceDelegate ng/service/$templateCache ng/service/$timeout ng/service/$window ng/type ng/type/$cacheFactory.Cache ng/type/$compile.directive.Attributes ng/type/$rootScope.Scope ng/type/angular.Module ng/type/form.FormController ng/type/ngModel.NgModelController ngAnimate ngAnimate/provider ngAnimate/provider/$animateProvider ngAnimate/service ngAnimate/service/$animate ngCookies ngCookies/service ngCookies/service/$cookies ngCookies/service/$cookieStore ngMessages ngMessages/directive ngMessages/directive/ngMessage ngMessages/directive/ngMessages ngMock ngMock/function ngMock/function/angular.mock.dump ngMock/function/angular.mock.inject ngMock/function/angular.mock.module ngMock/object ngMock/object/angular.mock ngMock/provider ngMock/provider/$exceptionHandlerProvider ngMock/service ngMock/service/$exceptionHandler ngMock/service/$httpBackend ngMock/service/$interval ngMock/service/$log ngMock/service/$timeout ngMock/type ngMock/type/angular.mock.TzDate ngMockE2E ngMockE2E/service ngMockE2E/service/$httpBackend ngResource ngResource/service ngResource/service/$resource ngRoute ngRoute/directive ngRoute/directive/ngView ngRoute/provider ngRoute/provider/$routeProvider ngRoute/service ngRoute/service/$route ngRoute/service/$routeParams ngSanitize ngSanitize/filter ngSanitize/filter/linky ngSanitize/service ngSanitize/service/$sanitize ngTouch ngTouch/directive ngTouch/directive/ngClick ngTouch/directive/ngSwipeLeft ngTouch/directive/ngSwipeRight ngTouch/service ngTouch/service/$swipe
personnages

AngularJS: API: ng/directive/ngHide

ngHide

  1. - directive in module ng

ngHide指令根據(jù)ngHide屬性上表達式來顯示或隱藏給定的HTML元素。元素的顯示或隱藏是通過刪除或添加ng-hide CSS 類到元素上來實現(xiàn)的。.ng-hide CSS 類是在AngularJS預定義的,并且設置顯示樣式為空(使用!important標記)。 對于CSP 模式請?zhí)砑?angular-csp.css 到你的html文件(參見ngCsp)。

<!-- when $scope.myValue is truthy (element is hidden) -->
<div ng-hide="myValue" class="ng-hide"></div>

<!-- when $scope.myValue is falsy (element is visible) -->
<div ng-hide="myValue"></div>

當ngHide表達式計算結果為真時,ng-hide CSS 類會被加到元素的class屬性中,從而讓它變?yōu)殡[藏。當為假時,ng-hide CSS 類會從元素移除,這樣元素就不會被隱藏。

為什么使用!important?

你可能想知道為什么要在ng-hide CSS類上使用!important。這是因為 .ng-hide選擇器很容易被級別更高的選擇器覆蓋。例如,一些簡單的改變HTML列表條目的顯示樣式會讓隱藏的元素顯示。這成為了處理CSS框架時最大的問題。

通過使用!important,顯示和隱藏行為會按預期工作,而不管CSS選擇器間的任何沖突(當!important沒用在任何相矛盾的樣式上時)。如果開發(fā)者決定覆蓋樣式來改變?nèi)绾坞[藏元素,那只需要在自己的CSS代碼中配合使!important即可。

覆蓋 .ng-hide

默認情況下,.ng-hide類使用display:none!important格式化元素。如果你希望改變ngShow/ngHide的隱藏行為,可通過在CSS中重新定義.ng-hide類來實現(xiàn):

.ng-hide {
  /* this is just another form of hiding an element */
  display:block!important;
  position:absolute;
  top:-9999px;
  left:-9999px;}

默認情況下你不需要覆蓋CSS中任何東西,動畫就會針對顯示樣式生效。

關于ngHide動畫的一個注意點

ngShow/ngHide中動畫的顯示和隱藏事件會在指令表達式為真或假時觸發(fā)。 這個系統(tǒng)工作方式像ngClass的動畫系統(tǒng)。除了.ng-hide CSS 類的添加、刪除可以用你自己替換的CSS類。

////a working example can be found at the bottom of this page
//.my-element.ng-hide-add, .my-element.ng-hide-remove {transition:0.5s linear all;}

.my-element.ng-hide-add { ... }
.my-element.ng-hide-add.ng-hide-add-active { ... }
.my-element.ng-hide-remove { ... }
.my-element.ng-hide-remove.ng-hide-remove-active { ... }

記住,AngularJS的1.3.0-beta.11版本里, 不需要通過阻塞動畫過程來改變顯示屬性,ngAnimate會為你自動處理樣式的切換。

指令信息

  • 這個指令執(zhí)行優(yōu)先級為0.

用法

  • 作為屬性使用:
    <ANY
      ng-hide="">
    ...
    </ANY>

動畫

removeClass: .ng-hide - 在ngHide表達式計算結果為真時生效,并且是在內(nèi)容被隱藏前。

addClass: .ng-hide - 在ngHide表達式計算結果為非真時生效,并且是在內(nèi)容被顯示前。

點擊這里 了解更多關于涉及動畫的步驟。

參數(shù)

參數(shù) 類型 詳述
ngHide expression

如果表達式為真則隱藏元素,否則顯示。

示例

index.html
Click me: <input type="checkbox" ng-model="checked"><br/><div>
  Show:
  <div class="check-element animate-hide" ng-show="checked">
    <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
  </div>
</div><div>
  Hide:
  <div class="check-element animate-hide" ng-hide="checked">
    <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
  </div>
</div>
glyphicons.css
@import url(//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css);
animations.css
.animate-hide {
  -webkit-transition:all linear 0.5s;
  transition:all linear 0.5s;
  line-height:20px;
  opacity:1;
  padding:10px;
  border:1px solid black;
  background:white;}

.animate-hide.ng-hide {
  line-height:0;
  opacity:0;
  padding:0 10px;}

.check-element {
  padding:10px;
  border:1px solid black;
  background:white;}
protractor.js
var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));

it('should check ng-show / ng-hide', Function() {
  expect(thumbsUp.isDisplayed()).toBeFalsy();
  expect(thumbsDown.isDisplayed()).toBeTruthy();

  element(by.model('checked')).click();

  expect(thumbsUp.isDisplayed()).toBeTruthy();
  expect(thumbsDown.isDisplayed()).toBeFalsy();});
Article précédent: Article suivant: