https://github.com/jogboms/nativescript-ng-gradient
An angular directive to add gradients to Nativescipt elements
https://github.com/jogboms/nativescript-ng-gradient
Last synced: about 2 months ago
JSON representation
An angular directive to add gradients to Nativescipt elements
- Host: GitHub
- URL: https://github.com/jogboms/nativescript-ng-gradient
- Owner: jogboms
- License: mit
- Created: 2017-06-22T11:08:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-31T11:43:52.000Z (about 8 years ago)
- Last Synced: 2024-12-13T17:14:51.417Z (10 months ago)
- Language: TypeScript
- Size: 17.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Nativescript + Angular Gradients
An Angular directive for adding Gradients to your Nativescript UI.## How To
* Install.
```
tns plugin add nativescript-ng-gradient
```* In your App module.
``` javascript
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptModule } from "nativescript-angular/nativescript.module";
import { NSGradientDirectiveModule } from "nativescript-ng-gradient";
import { AppComponent } from "./app.component";@NgModule({
declarations: [ AppComponent ],
bootstrap: [ AppComponent ],
imports: [
NativeScriptModule,
NSGradientDirectiveModule
],
schemas: [ NO_ERRORS_SCHEMA ]
})
export class AppModule { }```
* In your Component.
``` javascript
import { Component } from "@angular/core";
import { Types, Orientation } from "nativescript-ng-gradient";@Component({
selector: 'ns-app',
template: `
`
})
export class AppComponent {
public gColors = ['#666666', '#eeeeee'];
public gType = Types.LINEAR_GRADIENT;
public gOrient = Orientation.LEFT_RIGHT;
public gRadius = 0;
}
```### Properties
`[nsgrad]` : Initiates the Directive with an optional value of an array of colors. Defaults to a gradient from black to white.`[nsgradType]` : Specifies the type of gradient to use. Defaults to `Types.LINEAR_GRADIENT`
`[nsgradOrient]` : Specifies the Orientation of the gradient. Defaults to `Orientation.LEFT_RIGHT`
`[nsgradRadius]` : Specifies the Radius of the gradient is any. Defaults to `0` (none);
### Note
Still can't seem to get RADIAL_GRADIENT to work and this only supported on Android for now.* Thats all. No dependencies.
## License
[MIT](/LICENSE)