JSFiddle - React, Tailwind, and code Playground

by dream apple

HTML

<div ng-app='MyApp'>
    <div ng-controller="testA">                                               
      <button ng-click="getData()">get</button>
    </div>
</div>

JavaScript

var app = angular.module('MyApp', []);
 app.controller('testA', ['$scope', 'remoteData' , function($scope, remoteData){
     console.log ('come in controller');
     $scope.getData = function(){
         console.log('name:' + remoteData.name + '  value:' + remoteData.value);
     }
 }]);

 app.factory('remoteData', function(){
     var data = {name:'n', value:'v'};                                     
     return data;
 })