# ts-extensions

> This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.1.

Latest version **0.0.0** (published 2020-01-04) · 0 weekly downloads

## Install

```sh
npm install ts-extensions
pnpm add ts-extensions
yarn add ts-extensions
bun add ts-extensions
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2020-01-04 |
| First published | 2020-01-04 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 600 KB |
| Known vulnerabilities | 0 (+24 in 4 direct dependencies) |
| Install scripts | no |
| Maintainers | toreaurstad |

## Links

- npm: https://www.npmjs.com/package/ts-extensions
- npm.io page: https://npm.io/package/ts-extensions

## Dependencies (12)

- [rxjs](https://npm.io/package/rxjs.md) ~6.4.0
- [tslib](https://npm.io/package/tslib.md) ^1.10.0
- [zone.js](https://npm.io/package/zone.js.md) ~0.9.1
- [@angular/core](https://npm.io/package/@angular/core.md) ~8.2.0
- [@angular/forms](https://npm.io/package/@angular/forms.md) ~8.2.0
- [@angular/common](https://npm.io/package/@angular/common.md) ~8.2.0
- [@angular/router](https://npm.io/package/@angular/router.md) ~8.2.0
- [@angular/compiler](https://npm.io/package/@angular/compiler.md) ~8.2.0
- [@angular/animations](https://npm.io/package/@angular/animations.md) ~8.2.0
- [serialize-javascript](https://npm.io/package/serialize-javascript.md) >=2.1.1
- [@angular/platform-browser](https://npm.io/package/@angular/platform-browser.md) ~8.2.0
- [@angular/platform-browser-dynamic](https://npm.io/package/@angular/platform-browser-dynamic.md) ~8.2.0

## Recent versions

- 0.0.0 (latest) — 2020-01-04

## README

# TsExtensions

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.1.

To use these Linq helper methods just do the same as in the app.component.ts file

Note that the component imports './array-extensions' 
This will import the necessary Array prototype methods for Where and FirstOrDefault or other similar methods. 

These two supports predicate methods passed into them. 


```typescript

import { Component, Inject } from '@angular/core';
import { StarWarsMovies } from './starwarsmovies';
import { Movie } from './movie';
import './array-extensions';



@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'Linq TsExtensions demo';

  firstMovieWithBoba: Movie;
  allMoviesWithLeia: Movie[];
  starwarsMovies: string;

  constructor() {
    this.starwarsMovies = JSON.stringify(StarWarsMovies);
    this.firstMovieWithBoba = StarWarsMovies.FirstOrDefault<Movie>(m => m.main_characters.indexOf('Boba Fett') > 0);
    this.allMoviesWithLeia = StarWarsMovies.Where<Movie>(m => m.main_characters.indexOf('Princess Leia Organa') > 0);
    console.log(this.firstMovieWithBoba);
    console.log(this.allMoviesWithLeia);
  }



}


```








## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

---
_Source: https://npm.io/package/ts-extensions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
