This article mainly introduces the angularjs ng-include directive.Here is the basic knowledge of ng-include.And attached code examples,Have
angularjs ng-include directive
Include html file:
<! Doctype html> <html> <head> <meta charset="utf-8"> <script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script> </head> <body ng-app=""> <div ng-include="" myfile.htm ""></div> </body> </html>
myfile.htm file title
This text comes from the included file myfile.htm!
Definition and usage
The ng-include directive is used to include external html files.
The contained content will be the children of the specified element.
The value of the ng-include attribute can be an expression,Returns a file name.
by default,The included files need to be included under the same domain name.
<element ng-include="filename" onload="expression" autoscroll="expression"></element>
The ng-include directive is used as an element:
<ng-include src="filename" onload="expression" autoscroll="expression"></ng-include>
All html elements support this directive.
|filename||File name. You can use an expression to return the file name.|
|onload||Optional, the expression to be executed after the file is loaded.|
|autoscroll||Optional, whether the contained part is scrollable on the specified view.|
- python 3x - typeerror: 'method' object is not subscriptable
- python - you may need to restart the kernel to use updated packages error
- xcode - pod install [!] no `podfile 'found in the project directory
- android studio - unresolved reference comes out in kotlin
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - emulator: dsound: could not initialize about the error message directsoundcapture
- django - oserror: [winerror 123] the file name, directory name, or volume label syntax is incorrect : '<frozen importlib_boot
- mysql startup failed [error] innodb: the innodb_system data file 'ibdata1' must be writable
- python - importerror: cannot import name md5 error cannot be resolved