2

I'm really struggling with angular 2 .Any tips?

Comments
  • 0
    Whats wrong?
  • 0
    @searchindex
    1.The file structure is weird.am still confused about what goes where.
    2.typescript really urks me
  • 0
    Anyways I'm still in my Infancy Days of learning angular 2.I should get used to this stuff.but I'm still going to rant on about why the guys developing angular itself didn't make a features upgrade to angular 1.x and instead went with creating an entirely different framework.
  • 1
    Are you using angular CLI? If not, give it a try, it puts everything (except for services) where it should be automatically.

    Other than that, keep at it; it's definitely weird coming from ng1 but once you get the hang of it ng1 will seem clumsy by comparison.
  • 1
    @zmzmuazzam98
    I agree, Angular2 should have been named something else. But is what it is.
    Is weird in the beginning but it all makes sense.
    My advise is start with the cli and with visual studio code with language service addon installed.
    That will help a lot and unleash the power of typescript
  • 1
    @DevotedSniper
    *ngIf='showFlag' on the div
    And then in the component change showFlag variable to true/false will make the trick.
  • 0
    @DevotedSniper
    For that spinner i've done something similar. I did a component that i had to app.component (right after router-outlet) so it shows in every page. Let's call this spinner. The spinner subscribes (rxjs) to a service (lets call it busyservice). This service emits if the app is busy or not and then shows the spinner. Any angular element can inject busyService and say if the app is busy or not. I even did an override on the http service to block the app on every ajax call.

    How about this solution?
  • 0
    @DevotedSniper
    No worries, let me know if you need anything
Add Comment