JSFiddle - React, Tailwind, and code Playground

by Thunder Hemlock

JavaScript

function MyService() {
    this.doIt = function() {
        console.log("done
                    $window.alert('foobar');
    }
}


var myModule = angular.module("myModule", []);

myModule.service("myService", MyService);


myModule.controller("MyController", function($scope, myService) {

    myService.doIt();

});