Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 0797c85

Browse files
ThomasBurlesontinayuangao
authored andcommitted
fix(FlexLayoutModule): remove console.warn() conflicts with ngc+AOT (#179)
* ‘forRoot()' fn is never evaluated in AoT, ngc only analyzes the content of the fn to get the module and ngc does not know what to do with the first statetement (console.warn) * clarify changes to FlexLayoutModule.forRoot() * updates dependency to minimum of Angular v2.3.1. Refs http://github.com/angular/angular#14410 Fixes #174, Fixes #175, Fixes #176, Fixes #178.
1 parent 7a3f96b commit 0797c85

File tree

5 files changed

+23
-25
lines changed

5 files changed

+23
-25
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
### BREAKING CHANGES
2626

2727
* ObservableMedia: Deprecated use of `ObservableMediaService` opaque token. Developers now simply use the ObservableMedia class to inject the service.
28-
* FlexLayoutModule: Previously releases used FlexLayoutModule.forRoot(). This has been deprecated; and a console warning will be issued if used.
28+
* FlexLayoutModule: Previously releases used FlexLayoutModule.forRoot(); This has been deprecated.
2929

3030
*before*
3131

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
"node": ">= 5.4.1 < 7"
3737
},
3838
"dependencies": {
39-
"@angular/common": "^2.2.3",
40-
"@angular/compiler": "^2.2.3",
41-
"@angular/core": "^2.2.3",
42-
"@angular/platform-browser": "^2.2.3",
43-
"@angular/platform-browser-dynamic": "^2.2.3",
39+
"@angular/common": "^2.3.1",
40+
"@angular/compiler": "^2.3.1",
41+
"@angular/core": "^2.3.1",
42+
"@angular/platform-browser": "^2.3.1",
43+
"@angular/platform-browser-dynamic": "^2.3.1",
4444
"@types/gulp-util": "^3.0.30",
4545
"core-js": "^2.4.1",
4646
"reflect-metadata": "^0.1.8",
@@ -49,11 +49,11 @@
4949
"zone.js": "^0.7.2"
5050
},
5151
"devDependencies": {
52-
"@angular/compiler-cli": "^2.2.3",
53-
"@angular/forms": "^2.2.3",
54-
"@angular/http": "^2.2.3",
52+
"@angular/compiler-cli": "^2.3.1",
53+
"@angular/forms": "^2.3.1",
54+
"@angular/http": "^2.3.1",
5555
"@angular/material": "2.0.0-beta.0",
56-
"@angular/platform-server": "^2.2.3",
56+
"@angular/platform-server": "^2.3.1",
5757
"@angular/router": "~3.1.1",
5858
"@angular/tsc-wrapped": "~0.4.0",
5959
"@angularclass/conventions-loader": "^1.0.2",
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Component } from '@angular/core';
1+
import {Component} from '@angular/core';
22

33
@Component({
4-
selector: 'demos-docs-layout',
5-
template: `
4+
selector: 'demos-docs-layout',
5+
template: `
66
<demo-layout-alignment class="small-demo"> </demo-layout-alignment>
77
<demo-layout-fill class="small-demo"> </demo-layout-fill>
88
<demo-flex-row-fill class="small-demo"> </demo-flex-row-fill>
@@ -12,15 +12,15 @@ import { Component } from '@angular/core';
1212
<demo-flex-offset-values class="small-demo"> </demo-flex-offset-values>
1313
`
1414
})
15-
export class DemosLayoutAPI { }
15+
export class DemosLayoutAPI {
16+
}
1617

1718
import {NgModule} from '@angular/core';
1819
import {CommonModule} from "@angular/common";
1920
import {FormsModule} from "@angular/forms";
2021
import {MaterialModule} from "@angular/material";
2122
import {FlexLayoutModule} from "../../../lib"; // `gulp build:components` to deploy to node_modules manually
2223

23-
2424
import {DemoLayoutAlignment} from "./layoutAlignment.demo";
2525
import {DemoFlexRowFill} from "./flexRowFill.demo";
2626
import {DemoFlexRowFillWrap} from "./flexRowFillWrap.demo";
@@ -29,9 +29,8 @@ import {DemoFlexOffsetValues} from "./flexOffetValues.demo";
2929
import {DemoLayoutFill} from "./layoutFill.demo";
3030
import {DemoFlexAlignSelf} from "./FlexAlignSelf.demo";
3131

32-
3332
@NgModule({
34-
declarations : [
33+
declarations: [
3534
DemosLayoutAPI, // used by the Router with the root app component
3635

3736
DemoFlexRowFill,
@@ -42,12 +41,12 @@ import {DemoFlexAlignSelf} from "./FlexAlignSelf.demo";
4241
DemoLayoutFill,
4342
DemoFlexAlignSelf
4443
],
45-
imports : [
44+
imports: [
4645
CommonModule,
4746
FormsModule,
4847
MaterialModule,
4948
FlexLayoutModule
5049
]
51-
5250
})
53-
export class DemosLayoutAPIModule { }
51+
export class DemosLayoutAPIModule {
52+
}

src/lib/flexbox/_module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,11 @@ const ALL_DIRECTIVES = [
5757
declarations: ALL_DIRECTIVES,
5858
imports: [MediaQueriesModule],
5959
exports: [MediaQueriesModule, ...ALL_DIRECTIVES],
60-
providers: [ MediaMonitor ]
60+
providers: [MediaMonitor]
6161
})
6262
export class FlexLayoutModule {
6363
/** @deprecated */
6464
static forRoot(): ModuleWithProviders {
65-
console.warn('FlexLayoutModule.forRoot() has been deprecated and is no longer needed.');
6665
return {
6766
ngModule: FlexLayoutModule
6867
};

tools/scripts/release/npm_assets/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Gitter](https://badges.gitter.im/angular/flex-layout.svg)](https://gitter.im/angular/flex-layout))
66

77
Angular Flex Layout provides a sophisticated layout API using FlexBox CSS + mediaQuery.
8-
This module provides Angular (v2.x and higher) developers with component layout features using a
8+
This module provides Angular (v2.3.1 and higher) developers with component layout features using a
99
custom Layout API, mediaQuery observables,and injected DOM flexbox-2016 css stylings.
1010

1111
The Layout engine intelligently automates the process of applying appropriate FlexBox CSS to
@@ -26,10 +26,10 @@ While other Flexbox CSS libraries are implementations of:
2626
Angular Flex Layout - in contrast - is a pure-Typescript UI Layout engine with an implementation that:
2727

2828
* uses HTML attributes (aka Layout API) to specify the layout configurations
29-
* is currently only available for Angular (v2.x or higher) Applications.
29+
* is currently only available for Angular (v2.4.3 or higher) Applications.
3030
* is independent of Angular Material (v1 or v2).
3131
* requires no external stylesheets.
32-
* requires Angular v2.x or higher.
32+
* requires Angular v2.4.3 or higher.
3333

3434
<br/>
3535

0 commit comments

Comments
 (0)