0

I am using this statement in the Index.html file to bind the element: Show Products.

I see that is is bound in the Index fie by displaying its value there. But when the products1.html file opens, the bound field does not display. I want to use it in as a placeholder in an input box in products1.html.

I am thinking of re-creating index.html as an SPA, but not sure this will work. if I add products1.html as a template into the view. I expect I might have the same problem.

Yes I am a Angularjs newbie after 2 years of experience.

DCistaro
  • 73
  • 1
  • 8

1 Answers1

0

Assuming that you have different controllers for the two pages, it seems that your problem is that you are not sharing the data between those controllers. Each of the controllers define a scope. It looks like the information that you want to show is well loaded in the "Index.html" controller scope, but then is not passed to the "products1.html" controller. If that is the case, there is several solutions to share data between Angular controllers:

  1. Using services
  2. Using $state.go services
  3. Using stateparams
  4. using rootscope

You can check how to do it in: Share data between AngularJS controllers

Community
  • 1
  • 1
javier_el_bene
  • 450
  • 2
  • 10
  • 25