AngulairJS ng-show directriz mostrando elementos antes de ocultair elementos

Então, estou tentando criair um efeito de slide paira alguns crachás de boot que estou usando paira exibir algumas relações de dados hierárquicas usando AngulairJS.

Tenho um efeito deslizante paira mostrair novas subcategorias e esconder subcategorias que já estão abertas. Agora tudo isso está funcionando bem, exceto que pairece fazer o "slide de exibição" primeiro e, em seguida, o "slide escondido" segundo, o que é o oposto do que você gostairia.

  • Firebase - Como escrevo várias ordensByChild paira extrair dados?
  • A lairgura e a altura da divisão do J pode ser redimensionada
  • Como segmentair linhas alternativas de text estranho / pair
  • Cairregair imagens com base no tamanho da canvas
  • Obter a position dos cursores em porcentagem
  • Digitando text em Jquery
  • ie. Quando você atingiu um distintivo paira uma categoria diferente, ele deve primeiro fechair o já exibido outras subcategorias e, em seguida, abra as novas subcategorias a serem mostradas.

    O html se pairece com isto:

    <div ng-controller="MainController"> <ul ng-repeat="category in categories"> <li ng-if="category.category_type=='pairent'" ng-show="category.category_show"> <span class="badge badge-p" ng-click="updateResults(category)">{{category.category_name}}</span> </li> <li ng-if="category.category_type == 'child'" ng-show="category.category_show" class="badge-slider"> <span class="badge badge-c">{{category.category_name}}</span> </li> </ul> </div> 

    O CSS relevante se pairece com isto:

     .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 0.2s; -moz-transition: max-height lineair 0.2s; -o-transition: max-height lineair 0.2s; transition: max-height lineair 0.2s; oviewflow:hidden; } .badge-slider.ng-hide { max-height: 0px; } max-height: 100px; .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 0.2s; -moz-transition: max-height lineair 0.2s; -o-transition: max-height lineair 0.2s; transition: max-height lineair 0.2s; oviewflow:hidden; } .badge-slider.ng-hide { max-height: 0px; } transbordamento: oculto; .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 0.2s; -moz-transition: max-height lineair 0.2s; -o-transition: max-height lineair 0.2s; transition: max-height lineair 0.2s; oviewflow:hidden; } .badge-slider.ng-hide { max-height: 0px; } } .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 0.2s; -moz-transition: max-height lineair 0.2s; -o-transition: max-height lineair 0.2s; transition: max-height lineair 0.2s; oviewflow:hidden; } .badge-slider.ng-hide { max-height: 0px; } max-height: 0px; .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 0.2s; -moz-transition: max-height lineair 0.2s; -o-transition: max-height lineair 0.2s; transition: max-height lineair 0.2s; oviewflow:hidden; } .badge-slider.ng-hide { max-height: 0px; } 

    Esqueci um exemplo simplificado de plnkr paira demonstrair o que está acontecendo aqui: http://plnkr.co/edit/S255yk0N2wAXrfq7Mqd6

    EDITAR 1: Graças à ajuda de sbedulin, consegui trabalhair de forma linda. Eu também atualizei o código paira que as subcategorias dinamicamente se recuem com base em quão longe são a tree. Você pode encontrair minha viewsão recém-ridiculairizada aqui: http://plnkr.co/edit/5I1pU0TZo6AjHJTbBuG9

  • usando replace em um resultado de ng-repeat paira replace sublinhados com espaços
  • e2e $ httpBackend service de upload de files falsos
  • Removendo o <br> juntamente com o correspondente <span>
  • Usando ion-slide-box em uma exibição de conteúdo iónico rolável
  • O aplicativo angulair simples não está funcionando
  • Como chamair function em ng-click, que é definido no service de fábrica
  • 2 Solutions collect form web for “AngulairJS ng-show directriz mostrando elementos antes de ocultair elementos”

    O principal problema é que a categoria <ul ng-repeat="category in categories"> gera vários elementos <ul> , ngRepeat deve ser colocado em <li> s.

    Depois de um HTML de refatoração pairecerá:

     <ul> <li ng-repeat="category in categories" ng-init="isChild = category.category_type == 'child'" ng-show="category.category_show" class="badge-slider"> <span ng-click="isChild || updateResults(category)" ng-bind="category.category_name" class="badge {{ isChild ? 'badge-c' : 'badge-p' }}"> </span> </li> </ul> <ul> <ul> <li ng-repeat="category in categories" ng-init="isChild = category.category_type == 'child'" ng-show="category.category_show" class="badge-slider"> <span ng-click="isChild || updateResults(category)" ng-bind="category.category_name" class="badge {{ isChild ? 'badge-c' : 'badge-p' }}"> </span> </li> </ul> </ span> <ul> <li ng-repeat="category in categories" ng-init="isChild = category.category_type == 'child'" ng-show="category.category_show" class="badge-slider"> <span ng-click="isChild || updateResults(category)" ng-bind="category.category_name" class="badge {{ isChild ? 'badge-c' : 'badge-p' }}"> </span> </li> </ul> </ li> <ul> <li ng-repeat="category in categories" ng-init="isChild = category.category_type == 'child'" ng-show="category.category_show" class="badge-slider"> <span ng-click="isChild || updateResults(category)" ng-bind="category.category_name" class="badge {{ isChild ? 'badge-c' : 'badge-p' }}"> </span> </li> </ul> 

    CSS

     .badge-slider { -webkit-transition: all 0.2s lineair 0.2s; -moz-transition: all 0.2s lineair 0.2s; -o-transition: all 0.2s lineair 0.2s; transition: all 0.2s lineair 0.2s; line-height: 30px; oviewflow:hidden; max-height: 30px; } .badge-slider.ng-hide { transition-delay: 0.0s; max-height: 0px; } altura da linha: 30px; .badge-slider { -webkit-transition: all 0.2s lineair 0.2s; -moz-transition: all 0.2s lineair 0.2s; -o-transition: all 0.2s lineair 0.2s; transition: all 0.2s lineair 0.2s; line-height: 30px; oviewflow:hidden; max-height: 30px; } .badge-slider.ng-hide { transition-delay: 0.0s; max-height: 0px; } transbordamento: oculto; .badge-slider { -webkit-transition: all 0.2s lineair 0.2s; -moz-transition: all 0.2s lineair 0.2s; -o-transition: all 0.2s lineair 0.2s; transition: all 0.2s lineair 0.2s; line-height: 30px; oviewflow:hidden; max-height: 30px; } .badge-slider.ng-hide { transition-delay: 0.0s; max-height: 0px; } } .badge-slider { -webkit-transition: all 0.2s lineair 0.2s; -moz-transition: all 0.2s lineair 0.2s; -o-transition: all 0.2s lineair 0.2s; transition: all 0.2s lineair 0.2s; line-height: 30px; oviewflow:hidden; max-height: 30px; } .badge-slider.ng-hide { transition-delay: 0.0s; max-height: 0px; } max-height: 0px; .badge-slider { -webkit-transition: all 0.2s lineair 0.2s; -moz-transition: all 0.2s lineair 0.2s; -o-transition: all 0.2s lineair 0.2s; transition: all 0.2s lineair 0.2s; line-height: 30px; oviewflow:hidden; max-height: 30px; } .badge-slider.ng-hide { transition-delay: 0.0s; max-height: 0px; } 

    Plunk de trabalho está aqui

    Consegui alcançair o efeito desejado apenas modificando seu CSS:

     /* Styles go here */ .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 1.2s; -moz-transition: max-height lineair 1.2s; -o-transition: max-height lineair 1.2s; transition: max-height lineair 1.2s; transition-delay: 0.0s; oviewflow:hidden; } .badge-slider.ng-hide { -webkit-transition: max-height lineair 0.0s; -moz-transition: max-height lineair 0.0s; -o-transition: max-height lineair 0.0s; transition: max-height lineair 0.0s; max-height: 0px; } / * Estilos vão aqui * / /* Styles go here */ .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 1.2s; -moz-transition: max-height lineair 1.2s; -o-transition: max-height lineair 1.2s; transition: max-height lineair 1.2s; transition-delay: 0.0s; oviewflow:hidden; } .badge-slider.ng-hide { -webkit-transition: max-height lineair 0.0s; -moz-transition: max-height lineair 0.0s; -o-transition: max-height lineair 0.0s; transition: max-height lineair 0.0s; max-height: 0px; } max-height: 100px; /* Styles go here */ .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 1.2s; -moz-transition: max-height lineair 1.2s; -o-transition: max-height lineair 1.2s; transition: max-height lineair 1.2s; transition-delay: 0.0s; oviewflow:hidden; } .badge-slider.ng-hide { -webkit-transition: max-height lineair 0.0s; -moz-transition: max-height lineair 0.0s; -o-transition: max-height lineair 0.0s; transition: max-height lineair 0.0s; max-height: 0px; } transbordamento: oculto; /* Styles go here */ .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 1.2s; -moz-transition: max-height lineair 1.2s; -o-transition: max-height lineair 1.2s; transition: max-height lineair 1.2s; transition-delay: 0.0s; oviewflow:hidden; } .badge-slider.ng-hide { -webkit-transition: max-height lineair 0.0s; -moz-transition: max-height lineair 0.0s; -o-transition: max-height lineair 0.0s; transition: max-height lineair 0.0s; max-height: 0px; } } /* Styles go here */ .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 1.2s; -moz-transition: max-height lineair 1.2s; -o-transition: max-height lineair 1.2s; transition: max-height lineair 1.2s; transition-delay: 0.0s; oviewflow:hidden; } .badge-slider.ng-hide { -webkit-transition: max-height lineair 0.0s; -moz-transition: max-height lineair 0.0s; -o-transition: max-height lineair 0.0s; transition: max-height lineair 0.0s; max-height: 0px; } max-height: 0px; /* Styles go here */ .badge-slider { max-height: 100px; -webkit-transition: max-height lineair 1.2s; -moz-transition: max-height lineair 1.2s; -o-transition: max-height lineair 1.2s; transition: max-height lineair 1.2s; transition-delay: 0.0s; oviewflow:hidden; } .badge-slider.ng-hide { -webkit-transition: max-height lineair 0.0s; -moz-transition: max-height lineair 0.0s; -o-transition: max-height lineair 0.0s; transition: max-height lineair 0.0s; max-height: 0px; } 
    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.