2

I have some two ui-router states in my angular application, which works fine, like this:

app.config(["$stateProvider",
    function($stateProvider){
        $stateProvider
            .state("settings", {
                url: "/settings",
                views: {
                    "secondMenu": {
                        templateUrl: "second_menu.html?parent=settings",
                        controller: "settingsController"
                    },
                    "thirdMenu": {
                        template: empty_template
                    }
                }
            })
            .state("cabinet", {
            url: "/cabinet",
            views: {
                "secondMenu": {
                    templateUrl: "second_menu.html?parent=cabinet",
                    controller: "cabinetController"
                },
                "thirdMenu": {
                    template: empty_template
                }
            }
        })

But only part of my menu i need work with angular. Other part of menu must go to static (not angular) url of my site, like this:

<ul>
    <li><a href="/static-url/">static-url</a></li>
    <li><a ui-sref="cabinet">cabinet angular url</a></li>
    <li><a ui-sref="settings">settings angular</a></li>
</ul>

And when i click on angular-urls - i get need information in my ng-view , but if after then i click on static-url - my url changing from /#/cabinet (for ex.) to /static-url/, but query to server does not exist. Page content saving as in cabinet angular url.

How I can disabling angular ui-router working on /static-url/ ?

2
  • What do you mean by "query to server does not exist"? Commented Jul 24, 2014 at 2:02
  • query not maked. server access log is empty Commented Jul 24, 2014 at 4:02

1 Answer 1

1

So for future lurkers, here's what you need to do. Just add this attribute to your static page's anchor tag:

target="_self"

Like this:

<ul>
    <li><a href="/static-url/" target="_self">static-url</a></li>
    <li><a ui-sref="cabinet">cabinet angular url</a></li>
    <li><a ui-sref="settings">settings angular</a></li>
</ul>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.