Skip to content

Commit ddd6a96

Browse files
authored
Merge pull request #312 from edusperoni/angular-12-fix
fix(bottom-sheet): do not pass projectableNodes
2 parents b6bd2ed + 0558973 commit ddd6a96

File tree

5 files changed

+39
-25
lines changed

5 files changed

+39
-25
lines changed

demo-ng/package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"main": "src/main.ts",
44
"dependencies": {
55
"@mdi/font": "4.9.95",
6-
"@angular/animations": "~11.2.7",
7-
"@angular/common": "~11.2.7",
8-
"@angular/compiler": "~11.2.7",
9-
"@angular/core": "~11.2.7",
10-
"@angular/forms": "~11.2.7",
11-
"@angular/platform-browser": "~11.2.7",
12-
"@angular/platform-browser-dynamic": "~11.2.7",
13-
"@angular/router": "~11.2.7",
6+
"@angular/animations": "~12.1.0",
7+
"@angular/common": "~12.1.0",
8+
"@angular/compiler": "~12.1.0",
9+
"@angular/core": "~12.1.0",
10+
"@angular/forms": "~12.1.0",
11+
"@angular/platform-browser": "~12.1.0",
12+
"@angular/platform-browser-dynamic": "~12.1.0",
13+
"@angular/router": "~12.1.0",
1414
"@nativescript/core": "8.0.0",
15-
"@nativescript/angular": "~11.8.0",
15+
"@nativescript/angular": "~12.0.0",
1616
"@nativescript-community/ui-material-activityindicator": "file:../packages/activityindicator",
1717
"@nativescript-community/ui-material-bottomsheet": "file:../packages/bottomsheet",
1818
"@nativescript-community/ui-material-bottomnavigationbar": "file:../packages/bottomnavigationbar",
@@ -33,14 +33,14 @@
3333
"zone.js": "~0.11.4"
3434
},
3535
"devDependencies": {
36-
"@angular/cli": "~11.2.7",
37-
"@angular/compiler-cli": "~11.2.7",
36+
"@angular/cli": "~12.1.0",
37+
"@angular/compiler-cli": "~12.1.0",
3838
"@nativescript/android": "8.0.0",
3939
"@nativescript/ios": "8.0.0",
4040
"@nativescript/types": "~8.0.0",
4141
"@nativescript/webpack": "beta",
42-
"@ngtools/webpack": "~11.2.6",
43-
"typescript": "~4.0.0"
42+
"@ngtools/webpack": "~12.1.0",
43+
"typescript": "~4.2.0"
4444
},
4545
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
4646
"readme": "NativeScript Application"

demo-ng/src/main.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
// this import should be first in order to load some required settings (like globals and reflect-metadata)
2-
import { platformNativeScriptDynamic } from "@nativescript/angular";
2+
import { platformNativeScript, runNativeScriptAngularApp } from '@nativescript/angular';
33
import { themer } from '@nativescript-community/ui-material-core';
44
import { AppModule } from './app/app.module';
55

66
if (global.isIOS) {
77
themer.setPrimaryColor('#bff937');
8-
98
}
109

11-
// A traditional NativeScript application starts by initializing global objects,
12-
// setting up global CSS rules, creating, and navigating to the main page.
13-
// Angular applications need to take care of their own initialization:
14-
// modules, components, directives, routes, DI providers.
15-
// A NativeScript Angular app needs to make both paradigms work together,
16-
// so we provide a wrapper platform object, platformNativeScriptDynamic,
17-
// that sets up a NativeScript application and can bootstrap the Angular framework.
18-
platformNativeScriptDynamic().bootstrapModule(AppModule);
10+
runNativeScriptAngularApp({
11+
appModuleBootstrap: () => platformNativeScript().bootstrapModule(AppModule)
12+
});

demo-ng/src/polyfills.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* NativeScript Polyfills
3+
*/
4+
5+
// Install @nativescript/core polyfills (XHR, setTimeout, requestAnimationFrame)
6+
import '@nativescript/core/globals';
7+
// Install @nativescript/angular specific polyfills
8+
import '@nativescript/angular/polyfills';
9+
10+
/**
11+
* Zone.js and patches
12+
*/
13+
// Add pre-zone.js patches needed for the NativeScript platform
14+
import '@nativescript/zone-js/dist/pre-zone-polyfills';
15+
16+
// Zone JS is required by default for Angular itself
17+
import 'zone.js';
18+
19+
// Add NativeScript specific Zone JS patches
20+
import '@nativescript/zone-js';

demo-ng/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
},
1818
"include": ["src/tests/**/*.ts", "src/**/*.ios.ts", "src/**/*.android.ts"],
19-
"files": ["./src/main.ts", "./references.d.ts"],
19+
"files": ["./src/main.ts", "./references.d.ts", "./src/polyfills.ts"],
2020
"exclude": ["node_modules", "platforms", "e2e"]
2121
}
2222

src/bottomsheet/angular/bottomsheet.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class BottomSheetService {
118118
const detachedLoaderFactory = factoryResolver.resolveComponentFactory(DetachedLoader);
119119
const childInjector = this.createChildInjector(bottomSheetParams, viewContainerRef);
120120

121-
return viewContainerRef.createComponent(detachedLoaderFactory, 0, childInjector, null);
121+
return viewContainerRef.createComponent(detachedLoaderFactory, 0, childInjector);
122122
}
123123

124124
private async loadComponent(type: Type<any>, sheetRef: SheetRef): Promise<View> {

0 commit comments

Comments
 (0)