Giter VIP home page Giter VIP logo

angular-example-library's Introduction

Example library with Angular 5 + Angular CLI playground

Angular example library that can serve as base project if you want to build your own library
Report bug ยท Request feature

Deprecated This project is no longer maintained. If you want to create an angular library, check this.

Table of contents

Features

  • Sample component, service, directive and pipe
  • Unit tests with Karma and Jasmine
  • Playground with Angular CLI to test the library in a 'real application'
  • Linting
  • Automatic versioning
  • Documentation

Quick start

Warning: we strongly recommend node >=v6.9.0 and npm >=3.0.0

npm i - Installs project modules

npm run install-all - Installs project modules and playground modules

npm run clean - Removes every generated folder

npm run build - Builds the library using gulp

npm run build:watch - Builds the library using gulp waiting for changes

npm run docs - Generates all the documentation

npm start - Runs the playground and the build process waiting for changes

npm run link - Links the library folder in order to use it in the playground with npm link

npm run playground - Runs the playground (maybe you have to use sudo or have permissions)

npm run test - Runs the tests with karma and jasmine

npm run test:watch - Runs the tests with karma and jasmine waiting for changes

npm run lint - Runs the linter

Modify this project and make your own angular library:

Just in three steps:

  1. Rename every occurrence of 'angular-example-library' to 'your-library-name'.
  2. Modify src folder according to your need.
  3. npm run build

To release a new version of this library and publish it to npm, run:

$ npm run release

Remember to login in npm. The script (release.sh) will publish your dist folder.

Once you have published your library to npm, you can import your library in any Angular application by running:

$ npm install your-library-name

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

// Import your library
import { YourLibraryModule } from 'your-library-name';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Specify your library as an import
    YourLibraryModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {
}

Once your library is imported, you can use its components, directives and pipes in your Angular application.

Bugs and feature requests

Have a bug or a feature request? Please first read the issue guidelines and search for existing and closed issues. If your problem or idea is not addressed yet, please open a new issue.

Creators

Ismael Ramos

Buy Me a Coffee at ko-fi.com

Copyright and license

Code and documentation copyright 2011-2018 the authors. Code released under the MIT License.

Enjoy ๐Ÿค˜

angular-example-library's People

Contributors

ismaestro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.