Client Side Template with view per role

前端 未结 2 686
闹比i
闹比i 2021-01-19 12:01

I\'ve been reading about AngularJS and it seems very promising, the only thing I\'m trying to figure out, not specific for framework, but it\'s general for clie

2条回答
  •  青春惊慌失措
    2021-01-19 12:32

    Blesh is correct about only providing data to users with the appropriate role on the server side, but it sounds like you want to re-use pieces of your client UI.

    In AngularJS, you could use ng-include and build up different partials for different pieces of data. So you could write something like this in both your "doctor" and "nurse" views:

    And then have a separate HTML file called allergies.html:

    Allergy info: {{someData}}

    Another option would be to use directives.

提交回复
热议问题