diff --git a/CHANGELOG.md b/CHANGELOG.md
index f837d4b8d..7e0db94f5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,14 @@
+
+## [8.0.1](https://github.com/NativeScript/nativescript-angular/compare/8.0.0...8.0.1) (2019-06-12)
+
+
+### Bug Fixes
+
+* do not throw if element already registered ([#1838](https://github.com/NativeScript/nativescript-angular/issues/1838)) ([e90f8b5](https://github.com/NativeScript/nativescript-angular/commit/e90f8b5))
+* **1845:** CSS special selector ":host" only work first time ([#1852](https://github.com/NativeScript/nativescript-angular/issues/1852)) ([59a5bd8](https://github.com/NativeScript/nativescript-angular/commit/59a5bd8))
+
+
+
# [8.0.0](https://github.com/NativeScript/nativescript-angular/compare/7.2.4...8.0.0) (2019-05-29)
diff --git a/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_active_items.png b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_active_items.png
new file mode 100644
index 000000000..121886eda
Binary files /dev/null and b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_active_items.png differ
diff --git a/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_inactive_items.png b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_inactive_items.png
new file mode 100644
index 000000000..c8d8ffe29
Binary files /dev/null and b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_inactive_items.png differ
diff --git a/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_remove_items.png b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_remove_items.png
new file mode 100644
index 000000000..121886eda
Binary files /dev/null and b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_remove_items.png differ
diff --git a/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_reset_items.png b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_reset_items.png
new file mode 100644
index 000000000..996b6c4e5
Binary files /dev/null and b/e2e/animation-examples/e2e/resources/images/ng4animations/iPhone 7 12/add_reset_items.png differ
diff --git a/e2e/config/appium.capabilities.json b/e2e/config/appium.capabilities.json
index 5f36a351c..62ffb633d 100644
--- a/e2e/config/appium.capabilities.json
+++ b/e2e/config/appium.capabilities.json
@@ -120,6 +120,13 @@
"noReset": true,
"fullReset": false
},
+ "sim.iPhone7.ios12": {
+ "platformName": "iOS",
+ "platformVersion": "12.0",
+ "deviceName": "iPhone 7",
+ "noReset": true,
+ "fullReset": false
+ },
"sim.iPhone8.iOS112": {
"platformName": "iOS",
"platformVersion": "11.2",
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api21-Default/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api21-Default/home.png
new file mode 100644
index 000000000..c717be762
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api21-Default/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api21-Default/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api21-Default/support.png
new file mode 100644
index 000000000..c3009df52
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api21-Default/support.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api22-Default/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api22-Default/home.png
new file mode 100644
index 000000000..6ff400d3d
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api22-Default/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api22-Default/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api22-Default/support.png
new file mode 100644
index 000000000..a55be3589
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api22-Default/support.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api24-Default/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api24-Default/home.png
new file mode 100644
index 000000000..7e55d9dde
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api24-Default/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api24-Default/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api24-Default/support.png
new file mode 100644
index 000000000..6272bebf8
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api24-Default/support.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api25-Google/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api25-Google/home.png
new file mode 100644
index 000000000..d54e5fc0e
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api25-Google/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api25-Google/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api25-Google/support.png
new file mode 100644
index 000000000..d583b6dcf
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api25-Google/support.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api26-Google/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api26-Google/home.png
new file mode 100644
index 000000000..40de7e9c1
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api26-Google/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api26-Google/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api26-Google/support.png
new file mode 100644
index 000000000..bad8bb6e4
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api26-Google/support.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api28-Google/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api28-Google/home.png
new file mode 100644
index 000000000..985b2bacd
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api28-Google/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api28-Google/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api28-Google/support.png
new file mode 100644
index 000000000..e83f97176
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/Emulator-Api28-Google/support.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/iPhone 7 12/home.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/iPhone 7 12/home.png
new file mode 100644
index 000000000..81be31153
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/iPhone 7 12/home.png differ
diff --git a/e2e/routable-animations/e2e/resources/images/nsroanimations/iPhone 7 12/support.png b/e2e/routable-animations/e2e/resources/images/nsroanimations/iPhone 7 12/support.png
new file mode 100644
index 000000000..37ed5d73d
Binary files /dev/null and b/e2e/routable-animations/e2e/resources/images/nsroanimations/iPhone 7 12/support.png differ
diff --git a/e2e/routable-animations/e2e/setup.ts b/e2e/routable-animations/e2e/setup.ts
index 8b26e66e9..9c7b955b3 100644
--- a/e2e/routable-animations/e2e/setup.ts
+++ b/e2e/routable-animations/e2e/setup.ts
@@ -1,9 +1,9 @@
import { startServer, stopServer } from "nativescript-dev-appium";
-before("start server", async () => {
+before("start server", async function () {
await startServer();
});
-after("stop server", async () => {
+after("stop server", async function () {
await stopServer();
});
diff --git a/e2e/routable-animations/e2e/tests.e2e.ts b/e2e/routable-animations/e2e/tests.e2e.ts
index 170b8813c..a8c6e0c4b 100644
--- a/e2e/routable-animations/e2e/tests.e2e.ts
+++ b/e2e/routable-animations/e2e/tests.e2e.ts
@@ -5,11 +5,11 @@ describe("sample scenario", () => {
const defaultWaitTime = 5000;
let driver: AppiumDriver;
- before(async () => {
+ before(async function () {
driver = await createDriver();
});
- after(async () => {
+ after(async function () {
await driver.quit();
console.log("Quit driver!");
});
@@ -20,7 +20,7 @@ describe("sample scenario", () => {
}
});
- it("should go to support page", async () => {
+ it("should go to support page", async function () {
const btnGoToSupportPage = await driver.findElementByAutomationText("go to support page");
const homeImage = await driver.compareScreen("home");
assert.isTrue(homeImage);
@@ -29,7 +29,7 @@ describe("sample scenario", () => {
console.log(await titleSupportPage.text());
});
- it("should go back to home page", async () => {
+ it("should go back to home page", async function () {
const btnGoBackToHomePage = await driver.findElementByAutomationText("go back to home page");
const supportImage = await driver.compareScreen("support");
assert.isTrue(supportImage);
diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json
index e0b508fae..2a8e7bad8 100644
--- a/e2e/router-tab-view/package.json
+++ b/e2e/router-tab-view/package.json
@@ -17,8 +17,8 @@
"@angular/common": "8.0.0",
"@angular/compiler": "8.0.0",
"@angular/core": "8.0.0",
- "@angular/forms": "8.0.0-beta.10",
- "@angular/http": "8.0.0",
+ "@angular/forms": "8.0.0",
+ "@angular/http": "8.0.0-beta.10",
"@angular/platform-browser": "8.0.0",
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
diff --git a/e2e/router/e2e/router.e2e-spec.ts b/e2e/router/e2e/router.e2e-spec.ts
index 2af62f001..010d282fa 100644
--- a/e2e/router/e2e/router.e2e-spec.ts
+++ b/e2e/router/e2e/router.e2e-spec.ts
@@ -518,7 +518,7 @@ describe("Simple navigate and back should trigger only one CD on FirstComponent"
describe("Simple navigate and back should trigger only one CD on FirstComponent even with 3 changes in service", () => {
let driver: AppiumDriver;
- before(async () => {
+ before(async function () {
driver = await createDriver();
await driver.resetApp();
});
@@ -529,30 +529,30 @@ describe("Simple navigate and back should trigger only one CD on FirstComponent
}
});
- it("should find First", async () => {
+ it("should find First", async function () {
await assureFirstComponent(driver);
});
- it("should reset counter", async () => {
+ it("should reset counter", async function () {
await findAndClick(driver, "RESET");
await driver.waitForElement("CHECK: 1");
await driver.waitForElement("COUNTER: 0");
});
- it("should navigate to Second(1)/master", async () => {
+ it("should navigate to Second(1)/master", async function () {
await findAndClick(driver, "GO TO SECOND");
await assureSecondComponent(driver, 1);
await assureNestedMasterComponent(driver);
});
- it("should increase counter", async () => {
+ it("should increase counter", async function () {
await findAndClick(driver, "TICK");
await findAndClick(driver, "TICK");
await findAndClick(driver, "TICK");
});
- it("should navigate back to First", async () => {
+ it("should navigate back to First", async function () {
await goBack(driver);
await assureFirstComponent(driver);
await driver.waitForElement("CHECK: 2");
diff --git a/nativescript-angular/element-registry.ts b/nativescript-angular/element-registry.ts
index 67985d94a..1eb64bcc3 100644
--- a/nativescript-angular/element-registry.ts
+++ b/nativescript-angular/element-registry.ts
@@ -17,7 +17,7 @@ export interface ViewExtensions {
}
export interface ViewClass {
- new (): View;
+ new(): View;
}
export abstract class InvisibleNode extends View implements NgView {
@@ -101,14 +101,10 @@ export function registerElement(
resolver: ViewResolver,
meta?: ViewClassMeta
): void {
- if (elementMap.has(elementName)) {
- throw new Error(`Element for ${elementName} already registered.`);
- } else {
- const entry = { resolver: resolver, meta: meta };
- elementMap.set(elementName, entry);
- elementMap.set(elementName.toLowerCase(), entry);
- elementMap.set(elementName.replace(camelCaseSplit, "$1-$2").toLowerCase(), entry);
- }
+ const entry = { resolver: resolver, meta: meta };
+ elementMap.set(elementName, entry);
+ elementMap.set(elementName.toLowerCase(), entry);
+ elementMap.set(elementName.replace(camelCaseSplit, "$1-$2").toLowerCase(), entry);
}
export function getViewClass(elementName: string): ViewClass {
diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json
index 72fbd40ae..3e30ba170 100644
--- a/nativescript-angular/package.json
+++ b/nativescript-angular/package.json
@@ -1,6 +1,6 @@
{
"name": "nativescript-angular",
- "version": "8.0.0",
+ "version": "8.0.1",
"description": "An Angular renderer that lets you build mobile apps with NativeScript.",
"homepage": "https://www.nativescript.org/",
"bugs": "https://github.com/NativeScript/nativescript-angular/issues",
@@ -70,6 +70,7 @@
"@angular/platform-browser-dynamic": "8.0.0",
"@angular/router": "8.0.0",
"codelyzer": "^4.5.0",
+ "conventional-changelog-cli": "^1.3.22",
"rxjs": "~6.3.3",
"tns-core-modules": "next",
"tslint": "^5.5.0",
diff --git a/nativescript-angular/renderer.ts b/nativescript-angular/renderer.ts
index 450c27f5d..aadc69a1a 100644
--- a/nativescript-angular/renderer.ts
+++ b/nativescript-angular/renderer.ts
@@ -57,8 +57,12 @@ export class NativeScriptRendererFactory implements RendererFactory2 {
return this.defaultRenderer;
}
- let renderer: NativeScriptRenderer = this.componentRenderers.get(type.id);
+ let renderer = this.componentRenderers.get(type.id);
if (renderer) {
+ if (renderer instanceof EmulatedRenderer) {
+ renderer.applyToHost(element);
+ }
+
return renderer;
}
diff --git a/tests/app/tests/renderer-tests.ts b/tests/app/tests/renderer-tests.ts
index 2a0984ed3..49c59ff2a 100644
--- a/tests/app/tests/renderer-tests.ts
+++ b/tests/app/tests/renderer-tests.ts
@@ -16,6 +16,7 @@ import { View, fontInternalProperty, backgroundInternalProperty } from "tns-core
import { nsTestBedAfterEach, nsTestBedBeforeEach, nsTestBedRender } from "nativescript-angular/testing";
import { ComponentFixture, TestBed, async } from "@angular/core/testing";
import { Observable, ReplaySubject } from "rxjs";
+import { Label } from "tns-core-modules/ui/label/label";
@Component({
template: ``
@@ -97,6 +98,37 @@ export class StyledLabelCmp2 {
}
}
+@Component({
+ selector: "host-styled",
+ styles: [`
+ Label {
+ color: blue;
+ }
+
+ :host Label {
+ color: red;
+ }
+ `
+ ],
+ template: ``
+})
+export class HostStyledCmp {
+ constructor(public elementRef: ElementRef) {
+ }
+}
+
+@Component({
+ selector: "host-styled-parent",
+ template: `
+
+
+ `
+})
+export class HostStyledParentCmp {
+ constructor(public elementRef: ElementRef) {
+ }
+}
+
@Component({
selector: "ng-if-label",
template: ``
@@ -251,6 +283,7 @@ describe("Renderer E2E", () => {
LayoutWithLabel, LabelCmp, LabelContainer,
ProjectableCmp, ProjectionContainer,
StyledLabelCmp, StyledLabelCmp2,
+ HostStyledCmp, HostStyledParentCmp,
NgIfLabel, NgIfThenElseComponent, NgIfMultiple,
NgIfTwoElements, NgIfMultiple,
NgIfElseComponent, NgIfThenElseComponent,
@@ -293,6 +326,18 @@ describe("Renderer E2E", () => {
});
});
+ it("applies component :host styles", () => {
+ return nsTestBedRender(HostStyledParentCmp).then((fixture) => {
+ const proxyView = fixture.componentRef.instance.elementRef.nativeElement;
+
+ for (let i = 0; i < 2; i += 1) {
+ const child = proxyView.getChildAt(i) as ProxyViewContainer;
+ const label = child.getChildAt(0) as Label;
+ assert.equal(Red, label.style.color.hex);
+ }
+ });
+ });
+
it("applies component styles from multiple sources", () => {
return nsTestBedRender(StyledLabelCmp2).then((fixture) => {
const componentRef: ComponentRef = fixture.componentRef;