You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-29Lines changed: 14 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,8 +232,8 @@ new FullScreenPosition();
232
232
233
233
```typescript
234
234
this.toppy
235
-
.position(position:Position)
236
-
.config(configuration:ToppyConfig= {})
235
+
.position(position:ToppyPosition)
236
+
.config(configuration:ToppyConfig= {})
237
237
.content('hello')
238
238
.create();
239
239
```
@@ -255,23 +255,7 @@ this.toppy
255
255
256
256
#### Component Data
257
257
258
-
When you host a component, you can control the overlay through `CurrentOverlay` service. As of now, this service has only one method called `close` to close the overlay from the host component. But, soon more API will be added to this service.
259
-
260
-
```typescript
261
-
// host component
262
-
@Component({
263
-
template: '<div>Some text</div>'
264
-
})
265
-
exportclassHostComponent {
266
-
constructor(private_overlay:CurrentOverlay) {}
267
-
268
-
close() {
269
-
this._overlay.close();
270
-
}
271
-
}
272
-
```
273
-
274
-
You can also set properties to component when creating the overlay.
258
+
When you host a component, you can control the overlay through `ToppyOverlay` service. Using this service you can access all properties that is provided in content. Also the properties comes with `close`.
275
259
276
260
```typescript
277
261
this.overlay=this._toppy
@@ -280,17 +264,18 @@ this.overlay = this._toppy
280
264
.create();
281
265
```
282
266
283
-
Now automatically all props are attached to host component and you can access it like,
284
-
285
267
```typescript
286
268
// host component
287
269
@Component({
288
270
template: '<div>Some text</div>'
289
271
})
290
-
exportclassHostComponent {
291
-
propName; // else tslint will throw error
292
-
constructor() {
293
-
console.log(this.propName); // will return 'toppy-test-prop'
272
+
exportclassHelloComponent {
273
+
constructor(publicoverlay:ToppyOverlay) {
274
+
console.log(this.overlay.props.propName); // will return 'toppy-test-prop'
0 commit comments