JSFiddle - React, Tailwind, and code Playground

by Rob Rothe

HTML

<div ng-app="myApp">
  <div ng-controller="AppCtrl">
    <md-button class="md-icon-button" ng-if="!isPlaying" ng-click="play()" aria-label="Play">
      Playing
    </md-button>
    <md-button class="md-icon-button" ng-if="isPlaying" ng-click="pause()" aria-label="Pause">
      Pause
    </md-button>
  </div>
</div>

JavaScript

angular
  .module('myApp', [])
  .controller('AppCtrl', AppCtrl)
  .factory('Service', Service);

function AppCtrl($scope, Service) {
  $scope.isPlaying = false;
  $scope.play = function() {
    //player.playVideo();
    $scope.isPlaying = true;
  }

  $scope.pause = function() {
    //player.pauseVideo();
    $scope.isPlaying = false;
  }
}

function Service($http) {
  var service = {
    getData: getData
  };

  return service;

  function getData() {
    return $http.get('https://api.zippopotam.us/us/90210');
  }
}