JSFiddle - React, Tailwind, and code Playground

by frishi

HTML

<script src="https://code.angularjs.org/1.3.1/angular.min.js"></script>
<div ng-controller="Controller1">
....code here...
 <div ng-controller="Controller2">
  ..more code here...
 </div>
 </div>

JavaScript

var app = angular.module('app', [])

.controller('Controller1',['$scope','myService',function($scope, myService) {
 	console.log(myService.foo)
}])

.controller('Controller2',['$scope','myService',function ($scope,myService) {
    console.log(myService.foo)
 }
])

.service('myService', ['$http', function($http) {
   this.foo = "some data"
}])