cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.


  <meta charset="utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

  <title>Angular Promise Queue</title>

    <link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
    <script src="http://www.loringdodge.com/files/angular-promise-queue.js"></script>

  <body ng-app="starter">

      <ion-header-bar class="bar-stable">
        <h1 class="title">Angular Promise Queue</h1>
      <ion-content class="padding">

      <p style="text-align:center">A way to queue up promises. In this case...queue up animations</p>

      <button id="start" class="button button-positive">

        <div class="slideLeft">This</div>
        <div class="slideRight">is</div>
        <div class="slideLeft">an</div>
        <div class="slideRight">example</div>
        <div class="slideLeft">of</div>
        <div class="slideRight">a</div>
        <div class="slideLeft">promise</div>
        <div class="slideRight">queue</div>


              word-slide {
  margin-top: 50px;
  text-align: center;

word-slide div {
  font-size: 24px;
  line-height: 40px;

.slideLeft {
  transform: translateX(-30px);
  opacity: 0;

.slideRight {
  transform: translateX(30px);
  opacity: 0;

.slideLeft.enter, .slideRight.enter {
  transform: translateX(0px);
  opacity: 1;
  transition: all 0.3s ease-out;

  left: 50%;
  transform: translateX(-50%);
  text-align: center;
              angular.module('starter', ['ionic', 'promise-queue'])

  .directive('wordSlide', function(PromiseQueue) {

    return {
      restrict: 'E',
      link: function($scope, $element, $attrs) {

        /* Listen for a transition! */
        var transitionEvent = whichTransitionEvent();

        var elements = $element.children();

        var promiseQueue = new PromiseQueue();

        var slideIn = function(el){
          return function(done) {
            angular.element(el).addClass('enter').one(transitionEvent, function(e) {


          var startButton = document.getElementById('start');
          angular.element(startButton).on('click', function() {

          function whichTransitionEvent(){
            var t;
            var el = document.createElement('fakeelement');
            var transitions = {

            for(t in transitions){
              if( el.style[t] !== undefined ){
                return transitions[t];


Loading ..................