JSFiddle - React, Tailwind, and code Playground

by Nilesh Injulkar

HTML

<script src="https://getfirebug.com/firebug-lite-debug.js"></script>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<link rel="stylesheet" href="http://getbootstrap.com/dist/css/bootstrap.min.css">
<script src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<script src="http://silviomoreto.github.io/bootstrap-select/javascripts/bootstrap-select.js"></script>
<link rel="stylesheet" href="http://silviomoreto.github.io/bootstrap-select/stylesheets/bootstrap-select.css">
<div ng-app="startApp">
<div ng-controller='NewSelectController'>
<select class="selectpicker" id="inputSystemLoggingId" 
data-html="true" ng-init="initDataSources()" ng-options="a.id for a in systemLoggingIds" 
ng-model="systemLoggingId">
</select>
</div>
</div>

JavaScript

var startAppModule = angular.module('startApp',[]);
startAppModule.controller('NewSelectController', function($scope, $http){
$scope.systemLoggingId = "4";
$scope.systemLoggingIds = [{"id":"4"}];

$scope.initDataSources = function() {

    $http({
        method: 'get',
        url: 'http://jsonplaceholder.typicode.com/posts/2'
    }).success(function (listSystemLoggingIds) {
        console.log($scope.systemLoggingIds);
        
        $scope.systemLoggingIds = [{"id":"5"}];
        $scope.systemLoggingId = "5";
        
        console.log($scope.systemLoggingIds);        
        $('#inputSystemLoggingId').selectpicker();  
    });
     
}
});