Skip to content

Commit c821617

Browse files
edcarrollmcosta74
authored andcommitted
fix(popup): Fixed globals being overidden on popup demo page (edcarroll#258)
Closes edcarroll#249
1 parent 650a6de commit c821617

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

demo/src/app/pages/modules/popup/popup.page.ts

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnInit, OnDestroy } from "@angular/core";
1+
import { Component, Input } from "@angular/core";
22
import { ApiDefinition } from "../../../components/api/api.component";
33
import { SuiPopupConfig } from "ng2-semantic-ui";
44

@@ -173,33 +173,22 @@ export class MyComponent {
173173

174174
@Component({
175175
selector: "example-popup-standard",
176-
template: exampleStandardTemplate
176+
template: exampleStandardTemplate,
177+
providers: [SuiPopupConfig]
177178
})
178-
export class PopupExampleStandard implements OnInit {
179-
// We only need to do this once.
180-
private _config:SuiPopupConfig;
181-
182-
constructor(public popupConfig:SuiPopupConfig) {
183-
this._config = new SuiPopupConfig();
184-
185-
Object.assign(this._config, popupConfig);
186-
Object.assign(this.popupConfig, new SuiPopupConfig());
187-
}
188-
189-
public ngOnInit():void {
190-
Object.assign(this.popupConfig, this._config);
191-
}
192-
}
179+
export class PopupExampleStandard {}
193180

194181
@Component({
195182
selector: "example-popup-template",
196-
template: exampleTemplateTemplate
183+
template: exampleTemplateTemplate,
184+
providers: [SuiPopupConfig]
197185
})
198186
export class PopupExampleTemplate {}
199187

200188
@Component({
201189
selector: "example-popup-placement",
202-
template: examplePlacementTemplate
190+
template: examplePlacementTemplate,
191+
providers: [SuiPopupConfig]
203192
})
204193
export class PopupExamplePlacement {
205194
@Input()

0 commit comments

Comments
 (0)