JSFiddle - React, Tailwind, and code Playground

by marson parulian

HTML

<script src="https://code.angularjs.org/angular-1.0.0rc9.js"></script>
<script src="https://cdn.rawgit.com/buberdds/angular-bootstrap-colorpicker/master/js/bootstrap-colorpicker-module.js"></script>
<div ng-app='thomasApp'>
 <div ng-controller="thomasCtrl">
    <div>slider value : {{slider}}</div>
    </div>
</div>

JavaScript

angular.module('thomasApp', ['colorpicker.module','anotherModule'])
.controller('thomasCtrl', ['$scope','Slider',function ($scope,Slider) {
    // Using our own Slider    
    $scope.slider = Slider ("99");

    // Using colorpicker.module's Slider 
    // $scope.slider = Slider.getSlider();
        
}])
// Factory on same module. This is the case if Slider is defined within the same module with the controller
/*
.factory('Slider', [function () {
    return function (val) {
        return  4444;
    };
}])
*/
;

angular.module('anotherModule',[])
// Factory on a different module. This is the case if Slider is defined within another module.
.factory('Slider', [function () {
    return function (val) {
        return  val;
    };
}])
;