Skip to content

phantomstudios/angular-lib

Repository files navigation

angular-lib

A collection of Angular libraries Phantom developed sites.

This project was generated with Angular CLI version 7.0.5.

NPM version Actions Status PR Welcome CodeQL

Package one-liner overview.

Introduction

Package introduction, couple of paragraphs, with small code example.

Clipboard

import {ClipboardModule} from '@phntms/angular-lib';

@NgModule({
  imports: [
    ClipboardModule,
  ],
})
export class Foo {}
<button [copyToClipboard]="copyMyContents" aria-label="Copy to clipboard">
  Copy to clipboard
</button>

Files drop area

Examples TBC.

Loading

See documentation.

Safe pipe

Examples TBC.

Scroll

See documentation.

Social share

import {getSocialNetworkShareLink, SocialNetwork} from '@phantom/angular';

class Foo {
  readonly socialNetwork = SocialNetwork;

  getShareUrl(social: SocialNetwork) {
    return getSocialNetworkShareLink(location.href, social);
  }
}
<a [attr.href]="getShareUrl(socialNetwork.FACEBOOK)" class="share-link">
  Share on Facebook
</a>

Window

See documentation.

Installation

Install this package with npm.

npm i @phntms/angular-lib

Usage

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. You can run the tests in watch mode if you prefer with ng test --watch=false. Make sure the project is build before running tests using npm run build. All tests are run in a pre-push hook meaning you will not be able to push broken code to the repo.

Testing locally

Build and test the project first.

npm run build

npm run test

From another project, link the build files as a dependency.

cd ~/projects/my-test-project

npm link ../phntms-angular-lib/dist/angular-lib/

API

Input

If package has different inputs, a list of inputs alongside descriptions of what they do, types, and if required / optional etc.

Output

If package has different outputs, a list of outputs alongside descriptions of what they do, types, etc.

Browser Support

If browser support is limited, a few lines about what's supported.

Planned

If package isn't completed, a list of features planned in future releases.

🍰 Contributing

Want to get involved, or found an issue? Please contribute using the GitHub Flow. Create a branch, add commits, and open a Pull Request or submit a new issue.

Please read CONTRIBUTING for details on our CODE_OF_CONDUCT, and the process for submitting pull requests to us!