JSFiddle - React, Tailwind, and code Playground

Angular controller test

by Csaba Hellinger

HTML

<div ng-app="app">
  <div ng-controller="MyController"></div>
</div>

JavaScript

angular.module('app', []).controller('MyController', function ($q) {
	console.log('hello');
  
  function getConfig(key) {
    var deferred = $q.defer();
    deferred.resolve('url');
    return deferred.promise;  
  }
  
  getConfig('test_key')
    .then(function (res) {
      console.log('TEST CFG THEN', res);
    })
    .catch(function (err) {
      console.log('TEST CFG ERROR', err);
    });  
  
});