Join the Stack Overflow Community
Stack Overflow is a community of 6.6 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

$stateProvider

    // Home route
    .state('dashboard', {
        url: '/dashboard',
        views: {
            '': { 
                    templateUrl: 'views/dashboard.html' ,
                    controller : 'WelcomeCtrl'
                },
            'columnOne@dashboard': { 
                templateUrl: 'views/addCompany.html',
                controller: 'homeController'
            }
        }
    });

//how to load addCompany tab on right click using angularjs ui router

share|improve this question
    
You can define this in your HTML element. You can provide a target attribute in the anchor element to keep it simple. <a target="_blank"......> – CrazyMac Jan 18 at 6:01
    
when I reload the page it always load dashboard template but I want to load the add company template – shubham arora 2 days ago
    
Angular is a single page web application. When you reload, it always depends on the URL that was mentioned and not based on the page you are currently in. – CrazyMac 2 days ago
    
@CrazyMac yeah it will be good for me to if you provide any idea how to load child URL on reload page and also when I go to new tab using context menu item "open in new tab". Thanks – shubham arora 2 days ago
    
If you want to land in a particular page on right click of a link, provide the mapping accordingly. For ex: if you want to land in addCompany.html, ensure you have a mapping for it and the right click URL should match that mapping. If your mapping for addCompany.html is /addCompany then your URL should be something like http://...../addCompany – CrazyMac 2 days ago

Use this code.

      <a ng-href="/columnOne@dashboard" target="_blank">New Tab</a>
share|improve this answer
    
it's fine but when i reload the page it execute the main controller where i m using $state.go either dashboard state or login, so how can i be in the same template after reload – shubham arora Jan 18 at 12:07
    
$state.reload();. I can't get your question. – Manikandan Jan 18 at 12:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.