small medium large xlarge

Generic-user-small
27 Nov 2017, 14:44
Oleg (3 posts)

Hello, David. The first edition of the tutorial explains how to apply a modal dialog with Angular 1. In order to apply the modal dialog for Angular 2, we can load ng-bootstrap (for example). But all such examples use spell type @Component, @NgModule… . How to adapt such a spelling to what is used in the tutorial? Or from which resource we can take an example of using a modal via var AppComponent = Component…? Thanks in advance.

Dmfcb_pragsmall
27 Nov 2017, 16:36
David Copeland (487 posts)

Not sure if I 100% understand, but if you are seeing examples that use @Component, you can use them as-is as the book should have you set up for TypeScript (which is what those annotations are).

If not, you can use plain JavaScript by calling functions. The examples in the book all do this, so you can adapt those to use the JavaScript functions by following the book’s examples from other things.

Sorry I can’t be more helpful—I haven’t set this up in Angular 2+ or I’d give you better direction :(

Dave

Generic-user-small
29 Nov 2017, 14:58
Oleg (3 posts)

I wanted to know how to connect a library such as ng-bootstrap (the complexity is that the textbook uses js, and all such resources use typescript). Fortunately, I managed to do it. As I did, I described here https://stackoverflow.com/questions/47533507/ng-bootstrap-datepicker-is-not-styled.

Another difficulty was that ng-bootstrap requires bootstrap 4.

Thank you for your reply and thanks for your wonderful book.

You must be logged in to comment