Skip to content

Commit ccdab37

Browse files
committed
feat(core): update to Angular v6.x.x and higher
BREAKING CHANGE: `forRoot()` on `NgwWowModule` has been removed as no longer necessary Before: ```ts import {NgwWowModule} from 'ngx-wow'; @NgModule({ declarations: [AppComponent, ...], imports: [NgwWowModule.forRoot()], bootstrap: [AppComponent] }) export class AppModule { } ``` After: ```ts import {NgwWowModule} from 'ngx-wow'; @NgModule({ declarations: [AppComponent, ...], imports: [NgwWowModule], bootstrap: [AppComponent] }) export class AppModule { }
1 parent ec56d5e commit ccdab37

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+30987
-13616
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ script: gulp test:ci
2323
after_success: gulp coveralls
2424

2525
cache:
26-
yarn: true
26+
directories:
27+
- node_modules
2728

.yo-rc.json

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"generator-ngx-library": {
3-
"version": "5.4.0",
3+
"version": "6.2.1",
44
"authorName": "Tine Kondo",
55
"authorEmail": "[email protected]",
66
"githubUsername": "tinesoft",
@@ -16,7 +16,7 @@
1616
"reveal",
1717
"animation"
1818
],
19-
"ngVersion": "2.0.0",
19+
"ngVersion": "6.0.0",
2020
"ngModules": [
2121
"core",
2222
"common"
@@ -34,12 +34,25 @@
3434
"README.md",
3535
"CHANGELOG.md",
3636
"config/karma.conf",
37-
"demo/src/app/**",
38-
"demo/src/styles.scss",
37+
"demo/src/app/home/**",
38+
"demo/src/app/getting-started/**",
3939
"demo/src/assets/logo.svg",
4040
"demo/src/index.html",
4141
"demo/src/favicon.ico",
42-
"src/**/*.*"
42+
"src/**/*.ts",
43+
".git/HEAD"
44+
],
45+
"deleteExclusions": [
46+
"README.md",
47+
"CHANGELOG.md",
48+
"config/karma.conf",
49+
"demo/src/app/home/**",
50+
"demo/src/app/getting-started/**",
51+
"demo/src/assets/logo.svg",
52+
"demo/src/index.html",
53+
"demo/src/favicon.ico",
54+
"src/**/*.ts",
55+
".git/HEAD"
4356
]
4457
}
4558
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 Tine Kondo
3+
Copyright (c) 2018 Tine Kondo
44

55
Permission is hereby granted, free of charge, to any person obtaining
66
a copy of this software and associated documentation files (the

README.md

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@
1616
View all the directives in action at https://tinesoft.github.io/ngx-wow
1717

1818
## Dependencies
19-
* [Angular](https://angular.io) (*requires* Angular 2 or higher, tested with 2.0.0)
19+
20+
* [Angular](https://angular.io) (*requires* Angular 6+, [v1.0.2](https://github.com/tinesoft/ngx-wow/tree/v1.0.2) is the latest version for Angular < 6 )
2021
* [WOW JS](http://mynameismatthieu.com/WOW/) (*requires* WOW JS 1.1 or higher, tested with 1.1.3)
2122

2223

2324
## Installation
25+
2426
Install above dependencies via *npm*. In particular for `WOW JS`, run:
2527
```shell
2628
npm install --save wowjs
2729
```
2830

2931
---
3032
##### Angular-CLI
33+
3134
>**Note**: If you are using `angular-cli` to build your app, make sure that `wowjs` is properly listed as a [global library](https://github.com/angular/angular-cli#global-library-installation), by editing your `angular-cli.json` as such:
3235
```
3336
"scripts": [
@@ -51,14 +54,18 @@ Also make sure that [Animate.css](which is already installed and used internally
5154
```
5255

5356
##### SystemJS
57+
5458
>**Note**:If you are using `SystemJS`, you should adjust your configuration to point to the UMD bundle.
5559
In your systemjs config file, `map` needs to tell the System loader where to look for `ngx-wow`:
60+
5661
```js
5762
map: {
5863
'ngx-wow': 'node_modules/ngx-wow/bundles/ngx-wow.min.js',
5964
}
6065
```
66+
6167
In your systemjs config file, `meta` needs to tell the System loader how to load `wowjs`:
68+
6269
```js
6370
meta: {
6471
'./node_modules/wowjs/dist/wow.min.js': {
@@ -89,37 +96,25 @@ npm install --save ngx-wow
8996
```
9097

9198
Once installed you need to import the main module:
92-
```js
99+
```ts
93100
import { NgwWowModule } from 'ngx-wow';
94101
```
95-
The only remaining part is to list the imported module in your application module. The exact method will be slightly
96-
different for the root (top-level) module for which you should end up with the code similar to (notice ` NgwWowModule.forRoot()`):
97-
```js
102+
103+
```ts
98104
import { NgwWowModule } from 'ngx-wow';
99105

100106
@NgModule({
101107
declarations: [AppComponent, ...],
102-
imports: [NgwWowModule.forRoot(), ...],
108+
imports: [NgwWowModule, ...],
103109
bootstrap: [AppComponent]
104110
})
105111
export class AppModule {
106112
}
107113
```
108114

109-
Other modules in your application can simply import ` NgwWowModule `:
110-
111-
```js
112-
import { NgwWowModule } from 'ngx-wow';
113-
114-
@NgModule({
115-
declarations: [OtherComponent, ...],
116-
imports: [NgwWowModule, ...],
117-
})
118-
export class OtherModule {
119-
}
120-
```
121115

122116
## Usage
117+
123118
Once the module is imported, you can use the `NgwWowService` in your component (i.e. `AppComponent`) to trigger reveal animation by calling `init()` or to be notified by WOW when an element is revealed.
124119

125120
Here is how it works:
@@ -176,5 +171,5 @@ See [WOW.js Documentation](https://github.com/matthieua/WOW#advanced-usage) to s
176171

177172
## License
178173

179-
Copyright (c) 2017 Tine Kondo. Licensed under the MIT License (MIT)
174+
Copyright (c) 2018 Tine Kondo. Licensed under the MIT License (MIT)
180175

config/karma.conf.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ module.exports = function (config) {
1616
require('karma-mocha-reporter'),
1717
require('karma-jasmine-html-reporter'),
1818
],
19-
2019
customLaunchers: {
21-
// chrome setup for travis CI
22-
Chrome_travis_ci: {
23-
base: 'Chrome',
20+
// Chrome setup for CI (Travis, Docker, ...)
21+
ChromeHeadlessCI: {
22+
base: 'ChromeHeadless',
2423
flags: ['--no-sandbox']
2524
}
2625
},
2726
files: [
2827
'./node_modules/wowjs/dist/wow.min.js',
2928
'./node_modules/animate.css/animate.min.css',
30-
{ pattern: './config/karma-test-shim.js', watched: false }
29+
{pattern: './config/karma-test-shim.js', watched: false}
3130
],
3231

3332
preprocessors: {

config/webpack.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const helpers = require('./helpers');
2-
const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
3-
const ContextReplacementPlugin = require('webpack/lib/ContextReplacementPlugin');
2+
const webpack = require('webpack');
43
const { CheckerPlugin } = require('awesome-typescript-loader');
54

65
const getConfig = (hasCoverage, isTddMode) => {
@@ -27,6 +26,7 @@ const getConfig = (hasCoverage, isTddMode) => {
2726
}
2827

2928
return {
29+
mode: 'none',
3030
devtool: 'inline-source-map',
3131
resolve: {
3232
extensions: ['.ts', '.js'],
@@ -75,14 +75,14 @@ const getConfig = (hasCoverage, isTddMode) => {
7575

7676
plugins: [
7777

78-
new LoaderOptionsPlugin({
78+
new webpack.LoaderOptionsPlugin({
7979
debug: false,
8080
options: {
8181
// legacy options go here
8282
}
8383
}),
8484
// Fixes linker warnings (see https://github.com/angular/angular/issues/11580)
85-
new ContextReplacementPlugin(
85+
new webpack.ContextReplacementPlugin(
8686
// fixes WARNING Critical dependency: the request of a dependency is an expression
8787
/(.+)?angular(\\|\/)core(.+)?/,
8888
helpers.root('src'), // location of your src

demo/.angular-cli.json

Lines changed: 0 additions & 91 deletions
This file was deleted.

demo/.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ yarn-error.log
3434
testem.log
3535
/typings
3636

37-
# e2e
38-
/e2e/*.js
39-
/e2e/*.map
40-
4137
# System Files
4238
.DS_Store
4339
Thumbs.db

demo/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ngx-wow-demo
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.6.0.
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.0.
44

55
## Development server
66

@@ -12,7 +12,7 @@ Run `ng generate component component-name` to generate a new component. You can
1212

1313
## Build
1414

15-
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.
15+
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.
1616

1717
## Running unit tests
1818

0 commit comments

Comments
 (0)