0

I have two html pages one is the main template(index) and other is the welcome page.the content of the maintemplate(i.e index page) is visible on every page . The index page contains a dropdown and on selection of dropdown,the data on the welcome page changes. I want to reload the welcome page on the drop down selection I am using location.reload(),but it reloads the entire page and I want to reload only the welcome page. Can somebody Help...Thanks

3
  • Don't use location.reload(), use ng-view and ng-router, where each of the dropdown selections would change the view. Commented Oct 19, 2015 at 5:03
  • 1
    Do you want to load welcome page again and again or you need to change the content (value) of welcome page ? Commented Oct 19, 2015 at 5:44
  • the content is based on the selection of dropdown say If A is selected A iis shows or if B is selected it show B Commented Oct 19, 2015 at 6:59

1 Answer 1

2

I would look at using $route.reload.

For example:

<select ng-change="refreshPage()"><!-- Your select box content. -->

JS:

function refreshPage()
{
    $route.reload();
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks,,I achieved it using $state.reload();.is it the correct way??

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.