My Page have some files and folders.What i am looking is on selecting any file/folder, its detail get open in new bootstrap tab. On selecting any file i am passing file type in a function (changeType ) in my home controller and catching it in Config
What I have tried:
---- Home Controller ----
myApp.controller("HomeController", ['$window', '$rootScope', '$scope', '$state', '$http', , function (.....) {
$scope.changeType = function (type) {
if (type == 'Folder') {
$state.go('Folder');
}
else if (viewName == 'File') {
$state.go('File');
}
}}
---- Index -----
<div id="divViews">
<div ui-view="mainModule1"></div>
<div ui-view="mainModule2"></div>
</div>
---- Route Config ----
myApp.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
$stateProvider.state('File', {
url: '/File',
views: {
'mainModule1': {
url: '',
templateUrl: '/Views/HtmlDashBoard/File.html',
controller: 'FileCtrl'
}
} .state('Folder', {
url: '/Folder',
views: {
'mainModule2': {
url: '',
templateUrl: '/Views/HtmlDashBoard/Folder.html',
controller: 'FolderCtrl'
}
}
Is there any way to pass views name from home controller to config file since i am making ui-views dynamically ?