Skip to content

Commit 749d4fc

Browse files
committed
feat($compile): Angular4 Support
Enabled support for Angular4 applications closes #5
1 parent ce500d0 commit 749d4fc

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77

88
# angular2-expandable-list
99

10-
> Expandable lists made easy for Angular2
10+
> Expandable lists made easy for Angular2+
1111
12-
angular2-expandable-list is an HTML `<angular2-expandable-list>` tag enhanced with styling and animation
12+
Angular2 Expandable List is an HTML `<angular2-expandable-list>` tag enhanced with styling and animation.
13+
now compatible with Angular4 too.
1314

14-
Plunker DEMO available [here](https://embed.plnkr.co/uAPJq0/)
15+
**Plunker DEMOs:**
16+
17+
* [Angular2 Expandable List with Angular2](https://embed.plnkr.co/uAPJq0/)
1518

1619
![screenshot](http://i.imgur.com/Qa402ev.gif)
1720

@@ -26,6 +29,7 @@ Plunker DEMO available [here](https://embed.plnkr.co/uAPJq0/)
2629
* [Options](#options)
2730
* [Properties](#properties)
2831
* [Attributes](#attributes)
32+
* [Angular 4](#angular-4)
2933
* [Changelog](#changelog)
3034
* [License](#license)
3135

@@ -259,6 +263,36 @@ export class AppComponent {
259263
| disabled | boolean | When applied to the `expandable-list-item`, disabled the
260264
| is-expanded | boolean | Reflect the expandable state of the item list element
261265

266+
## Angular 4
267+
268+
This module will work with Angular 4 projects but requires `@angular/animations`
269+
to be included in your project as the Angular animations are not part of the `@angular/core`
270+
library starting from the version >=4.
271+
272+
Make sure to include the `BrowserAnimationsModule` in your App module like in the following example:
273+
274+
```ts
275+
import { NgModule } from '@angular/core';
276+
import { BrowserModule } from '@angular/platform-browser';
277+
import { AppComponent } from './app.component';
278+
279+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
280+
281+
@NgModule({
282+
bootstrap: [ AppComponent ],
283+
declarations: [
284+
AppComponent,
285+
],
286+
imports: [
287+
BrowserModule,
288+
BrowserAnimationsModule, // Angular 4 Only
289+
],
290+
})
291+
export class AppModule { }
292+
```
293+
294+
Everything else will just work as before.
295+
262296
## Contributing
263297

264298
This package is using the AngularJS commit messages as default way to contribute

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular2-expandable-list",
33
"version": "0.0.0-development",
4-
"description": "Expandable lists made easy for Angular2",
4+
"description": "Expandable lists made easy for Angular2+",
55
"main": "index.js",
66
"scripts": {
77
"build": "webpack --config config/webpack.lib.js",
@@ -23,10 +23,13 @@
2323
"url": "https://github.com/andreasonny83/angular2-expandable-list.git"
2424
},
2525
"keywords": [
26-
"angular",
2726
"ng2",
27+
"ng4",
28+
"angular",
2829
"angular2",
30+
"angular4",
2931
"angular2-component",
32+
"angular4-component",
3033
"lists",
3134
"treeview"
3235
],
@@ -37,9 +40,9 @@
3740
},
3841
"homepage": "https://github.com/andreasonny83/angular2-expandable-list#readme",
3942
"peerDependencies": {
40-
"@angular/common": "^2.0.0",
41-
"@angular/core": "^2.0.0",
42-
"@angular/platform-browser": "^2.0.0"
43+
"@angular/common": ">=2.0.0",
44+
"@angular/core": ">=2.0.0",
45+
"@angular/platform-browser": ">=2.0.0"
4346
},
4447
"devDependencies": {
4548
"@angular/common": "2.4.9",

0 commit comments

Comments
 (0)