https://github.com/wangta69/ng-functions
ng-functions
https://github.com/wangta69/ng-functions
Last synced: 2 months ago
JSON representation
ng-functions
- Host: GitHub
- URL: https://github.com/wangta69/ng-functions
- Owner: wangta69
- License: mit
- Created: 2018-03-19T05:06:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T07:04:52.000Z (almost 5 years ago)
- Last Synced: 2025-03-09T16:36:32.188Z (3 months ago)
- Language: TypeScript
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng-functions
A collection of commonly used functions for angular [Tested for angular6]## Installation
```
npm install ng-functions
```## Installation [angular 5.x]
```
npm install [email protected]
```## How to use
### imports
```app.module.ts
import { CommonServiceModule } from "ng-functions";
@NgModule({
imports: [CommonServiceModule]
})
```
```
import { CommonService } from "ng-functions";
constructor(protected commonSvc: CommonService) {
let prefix_unique = commonSvc.guid();
}
``````
randomString(number);//return alphaNumeric random string as given number length;
in_array(needle, haystack);//if needle is in array return true else return false
array_search(needle, haystack);//if needle is in array return index else return false
```