Angular Fixed Element
This Angular plug-in allows you to keep items on the page at the top.
Demo
Click here for a live demo.
Installation
You can use npm to install the package.
NPM
npm install --save ng-fixed-element
Use
Follow the steps below to add the ng-fixed-element package to your project.
1. Import NgFixedElementModule Import NgFixedElementModule in the module you want to use in your application.
;; /* Import the module */; ; @
2. Use within HTML Give the ngFixedElement directive to the object you want to fix. Example;
Sidebar Item 1 Sidebar Item 2 Sidebar Item 3 Sidebar Item 4 Sidebar Item 5 Sidebar Item 6
If you do not want to give a space above, you can remove the [marginTop] property, which will be 0 by default.
Features
Name | Type | Required | Default | Description |
---|---|---|---|---|
marginTop | Number | No | 0 | Sets the spacing of the pinned object from above. |