angular.js - How to implement tab switching in angularjs?
某草草
某草草 2017-05-15 17:02:02
0
2
734

That’s it. When these two buttons are clicked, the response data will be loaded. If not clicked, the default first tab will be loaded.

So, how to add different controllers to these two tabs.

The problem now is that these two tabs are just one row under the table. Are there any problems with routing?


某草草
某草草

reply all(2)
黄舟

Can be usedurl来控制两个tab是不同的controller

------The following was added after the subject modified the problem description-------

What is the relationship between

routing control and whether is a table and the next line in it?

漂亮男人

It’s good to use ng-include,

  1. ng-include可以动态引入不同的template,适合你这里的tabYou can dynamically introduce different template to suit your tab needs

  2. Every template里自己写自己的controller is fine, how simple, for example:

tab1_template

<p ng-controller="tab1Ctrl">
    ....
    ....
</p>

tab2_template

<p ng-controller="tab2Ctrl">
    ....
    ....
</p>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template