0

when I navigate to URL of my app:

http://localhost/RealSuiteApps/RealHelp/-1/Inbox/Detail?wonum=XXX

I want to get the value of wonum

Below is the constructor of my controller, I tried to use $location service as defined in angular documentation, but it doesnt work, what is the problem?

    constructor(private dataService: DataService, private $location) {
        var params = $location.search();
        var wonum = params.wonum;
        this.getWorkOrderDetail(wonum);
    }

enter image description here

Please note, the URL above is a link from one page to another, but it is not angular routing.

UPDATE

Adding # after Detail and before the question mark solves the issue

http://localhost/RealSuiteApps/RealHelp/-1/Inbox/Detail#/?wonum=BCB18405240

1
  • are you getting any errors? Commented Sep 27, 2016 at 17:10

1 Answer 1

2

I suspect if its an angular application. Because an angular application will always append a # to the url and that is how angular maintains state of url's. $location.search() method will yield results only if the url is hash based.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, indeed,adding # before the question mark solves the problem... thanks

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.