All Projects → alex-klock → ng2-fused

alex-klock / ng2-fused

Licence: MIT License
FuseBox plugins and utilities for building Angular2 applications.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to ng2-fused

ng-data-picker
🏄🏼 A data picker based on Angular 4+ (like native datetime picker of iOS)
Stars: ✭ 24 (+84.62%)
Mutual labels:  angular2, ng2
ng2-storage
A local and session storage wrapper for angular 2.
Stars: ✭ 14 (+7.69%)
Mutual labels:  angular2, ng2
ic-datepicker
Angular (2+) datepicker component
Stars: ✭ 27 (+107.69%)
Mutual labels:  angular2, ng2
Ng2 Nouislider
Angular2 noUiSlider directive
Stars: ✭ 181 (+1292.31%)
Mutual labels:  angular2, ng2
ng2-STOMP-Over-WebSocket
STOMP Over WebSocket service for angular2
Stars: ✭ 35 (+169.23%)
Mutual labels:  angular2, ng2
Truly Ui
Truly-UI - Web Angular UI Components for Desktop Applications (Electron, NW, APP JS)
Stars: ✭ 195 (+1400%)
Mutual labels:  angular2, ng2
ng2-fontawesome
An easy-to-use directive for font awesome icons.
Stars: ✭ 20 (+53.85%)
Mutual labels:  angular2, ng2
Ng2 Smart Table
Angular Smart Data Table component
Stars: ✭ 1,590 (+12130.77%)
Mutual labels:  angular2, ng2
ng-leaflet
Angular 2 component for Leaflet 1.x (WIP - Help Wanted)
Stars: ✭ 16 (+23.08%)
Mutual labels:  angular2, ng2
awesome-angular
💖 A list of awesome Angular (2️⃣➕) resources
Stars: ✭ 61 (+369.23%)
Mutual labels:  angular2, ng2
Angular Google Maps
Angular 2+ Google Maps Components
Stars: ✭ 1,982 (+15146.15%)
Mutual labels:  angular2, ng2
ng-elm
Write Angular components in Elm.
Stars: ✭ 41 (+215.38%)
Mutual labels:  angular2, ng2
Ng2 Search Filter
Angular 2 / Angular 4 / Angular 5 custom pipe npm module to make a search filter on any input, 🔥 100K+ downloads
Stars: ✭ 137 (+953.85%)
Mutual labels:  angular2, ng2
angular2-signature-pad
Signature pad component for Angular 2.x and above.
Stars: ✭ 17 (+30.77%)
Mutual labels:  angular2, ng2
Ngx Date Fns
⏳ date-fns pipes for Angular 2.0 and above ⏳
Stars: ✭ 135 (+938.46%)
Mutual labels:  angular2, ng2
fliphub
the easiest app builder
Stars: ✭ 30 (+130.77%)
Mutual labels:  bundler, fusebox
Ng2 Breadcrumbs
A breadcrumb service for the Angular 7 router
Stars: ✭ 61 (+369.23%)
Mutual labels:  angular2, ng2
Ng2 Konva
Angular & Canvas - JavaScript library for drawing complex canvas graphics using Angular.
Stars: ✭ 78 (+500%)
Mutual labels:  angular2, ng2
angular-progress-http
[DEPRECATED] Use @angular/common/http instead
Stars: ✭ 43 (+230.77%)
Mutual labels:  angular2, ng2
ng-seed
Simple Angular seed project with commonly used features.
Stars: ✭ 12 (-7.69%)
Mutual labels:  angular2, ng2

ng2-fused

FuseBox plugins and utilities for building Angular2 applications. Templating, Lazy Loaded Modules, and Spec Bundle support.

Installation

npm install ng2-fused --save-dev

NPM

Check out the ng2-fused-seed project for a working starter project utilizing the following plugins. Or fusebox-angular-universal-starter for a fully featured angular2 seed.

Ng2TemplatePlugin

Wraps url strings for templateUrl and styleUrls inside of require statements. Inspired by angular2-template-loader for webpack.

Usage

Just call the Ng2TemplatePlugin() within the FuseBox plugins array.

You should also use the RawPlugin so that the imported stylesheet gets exported as a text string.

const { FuseBox } = require('fuse-box');
const { Ng2TemplatePlugin } = require('ng2-fused');

const fuse = FuseBox.init({
    homeDir: './src',
    plugins: [
        Ng2TemplatePlugin(),
        ['*.component.html', RawPlugin()],
        ['*.component.css', RawPlugin()]
     //   or with a css pre/post processor...
     // ['*.component.css', PostCss([precss()]), RawPlugin()]   
    ]
});

...

fuse.run();

Before Transform...

@Component({
    selector: 'my-component',
    templateUrl: './my.component.html',
    styleUrls: ['./my.component.css']
})
export class MyComponent {}

After Transform...

@Component({
    selector: 'my-component',
    template: require('./my.component.html'),
    styles: [require('./my.component.css')]
})
export class MyComponent {}

Options

You can tweak the plugin with the following options:

ignoreStyleUrls
If true, will not convert the urls found within the styleUrls property.
ignoreTemplateUrl
If true, will not convert the url found within the templateUrl property.
templateUrlPattern
A RegExp object in case you need a custom pattern to match template urls.
styleUrlsPattern
A RegExp object in case you need a custom pattern to match style urls.
urlStringPattern
A RegExp object in case you need a custom pattern to match url strings.
plugins: [
    Ng2TemplatePlugin({ ignoreStyleUrls: true })
]

Ng2RouterPlugin

** O.5 Breaking Changes ** - Version 0.5 changed the behaviour of this plugin to better work for both JIT and AOT builds.

Converts Angular2 lazy loaded routes within loadChildren properties utilize a custom NgModuleFactoryLoader that works with FuseBox bundles (even ones bundled with the Quantum plugin). Also has a utility that will automatically configure FuseBox to automatically code split modules based on folder naming conventions (module folders beginning with "+"). Inspired by angular2-router-loader for webpack.

Usage

The plugin should be configured as a top level plugin.

const { FuseBox } = require('fuse-box');
const { Ng2RouterPlugin } = require('ng2-fused');

const fuse = FuseBox.init({
    homeDir: './src',
    plugins: [
        Ng2RouterPlugin({ 
            aot: config.aot,
            autoSplitBundle: 'app',
            vendorBundle: 'vendors'
        })      
    ]
});

...

fuse.run();

Options

You can tweak the plugin with the following options:

aot
Optional flag letting the plugin know whether or not this is an AOT build. Utilized to automatically handle module imports to look for .ngfactory extensions.
aotAppPath
The root app folder when building in aot build. Defaults to 'aot/app'.
appPath
The root app path folder. Defaults to 'app'.
autoSplitBundle
The name of the bundle to perform auto splitting on. If not set, auto splitting will be disabled.

Issues...

Currently the switching between AOT and JIT sometimes causes issues when FuxeBox's cache is used. As a workaround, when a build is executed, the cache folder is first deleted.

Ng2SpecBundlePlugin

This plugin allows for the creation of a spec bundle file that imports all spec files found in the project. This is more so required if using the QuantumPlugin. It should be used as a plugin for ONLY the bundle that the specs should be provided in.

fuse.bundle('app')
    .plugin(Ng2SpecBundlePlugin())
    ...

By default this plugin tests for the file /spec-bundle\.(ts|js)$/, if you wish for your spec bundle file to be named something different then you'll have to change this.

Options

cwd
The path search for specs in, used for glob searching for spec files. Defaults to `"build/workspace"`.
specPathPrefix
Defaults to '../', used as a prefix to the spec file paths.
specPattern
Glob pattern for finding specs. Defaults to `"**/*.spec.ts"`

Roadmap

  • Auto import of html and css for components if files are found in folder structure.
  • More unit tests.
  • More samples.

For a seed project utilizing FuseBox and Ng2Fused, check out https://github.com/alex-klock/ng2-fused-seed or https://github.com/patrickmichalina/fusebox-angular-universal-starter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].