Click here to Skip to main content
15,793,624 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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') {
            else if (viewName == 'File') {

---- Index -----
  <div id="divViews"> 
         <div ui-view="mainModule1"></div>
  <div ui-view="mainModule2"></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 ?
Updated 16-Jul-16 3:24am

1 solution

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900