JSFiddle - React, Tailwind, and code Playground
by Kshitij
HTML
<body ng-app='myApp'>
<div ng-controller='RandomController'>
<li>{{param}}</li>
</div>
</body>
JavaScript
var myApp = angular.module('myApp', ['ui.router']);
myApp.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
$stateProvider.state('state1', {
url: '/',
resolve: {
param1: ['RandomFactory', function (RandomFactory) {
RandomFactory();
}]
},
controller: 'RandomController',
});
$urlRouterProvider.otherwise("/");
}]);
myApp.factory('RandomFactory', ['', function () {
return "Hello there";
}])
myApp.controller('RandomController', ['$scope', function ($scope, param1) {
$scope.param = param1;
}]);