If i want to dynamically load a content in angularjs,Then we can use ng-include to achieve it. Today insus.net is in the asp.net mvc environment, for example to demonstrate its function.
You can load any other view dynamically in one view.If your dynamic content has many parts,You need to create corresponding action actions in the controller. For example, you do not need to create corresponding actions when using partial view. So this is what insus.net likes.
In addition, we need to take some parameters for the ng-include link! !! !!
Therefore, the parameters are implemented using the model:
Because of the ng-include link, give some view names or paths directly,Views cannot render some views directly.
Then we think of a way,Write a public view,All partial views can be loaded in this common view,Use this common view to render these partial views.
In the commonview action, we pass in a model to prepare for passing parameters later.
Next, I wrote this view:
The action to render part of the view is created.It also doesn't have much html code.
Let's create 2 partial views,Of course, in the actual environment,Maybe more than two.
Partial view 2:
Everything is ready beforeAll are for the following ng-include demonstration:
Program running results:
to sum up
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- i want to call a child component method from a parent in vuejs
- xcode - pod install [!] no `podfile 'found in the project directory
- dart - flutter: the instance member'stars' can't be accessed in an initializer error