Search code examples
javascriptangularjsangularjs-service

Data and Models in AngularJS


I have this WebApp with this HTML layout

Nav-column-| Center Column---- | Right Column

Link1---------|Data corresponding|Data Corresponding to Link1-A

Link2---------| to Nav-column------| (ie based oon Center Column Link)

Link3---------| Link1-A--------------|

----------------| Link1-B------------- |

I want to fully use AngularJS' strengths. I have separated the three columns are three different views, with Nav-column being loaded on page load. Now, I want to change the MODEL/DATA being displayed in the center column based on the link user clicks on the nav-column. How do I do that?

I understand that I dont need to change the view(which is stupid, I think). I need to change the data only.


Solution

  • I suggest you to a look to this great blog post proposing a solution for nesting views and routing. You will find a complete solution to manage views using ng-switchand ng-include similar to what Benoit Tremblay is saying.

    http://www.bennadel.com/blog/2441-Nested-Views-Routing-And-Deep-Linking-With-AngularJS.htm