TryCatchLearn / DatingApp30

Repo for dotnet core 3.0
113 stars 74 forks source link

"Welcome User" disappeared after adding 'dropdownToggle' #3

Closed webbwangatgmaildotcom closed 4 years ago

webbwangatgmaildotcom commented 4 years ago

Sir, I am following your class at Udemy,... I am at lesson 59.

After adding 'dropdownToggle' as shown below:

` <div *ngIf="loggedIn()" class="dropdown" dropdown> Welcome {{authService.decodedToken?.unique_name | titlecase}}

  <div class="dropdown-menu">
    <a class="dropdown-item" href="#"><i class="fa fa-user"></i> Edit Profile</a>
    <div class="dropdown-divider"></div>
    <a class="dropdown-item" href="#"><i class="fa fa-sign-out"></i>Logout</a>
  </div>
</div>`

the 'Welcome User' is gone and I received error in Inspector as below ERROR NullInjectorError: "R3InjectorError(AppModule)[AnimationBuilder -> AnimationBuilder -> AnimationBuilder]: NullInjectorError: No provider for AnimationBuilder!" Angular 8 BsDropdownDirective_Factory ngx-bootstrap-dropdown.js:543 Angular 4 NavComponent_div_17_Template nav.component.html:20 Angular 9 NavComponent_Template nav.component.html:20 Angular 28 core.js:5882:19 Angular 22

I can't go forward with the lesson... Appreciate it for any help!

IvanJasenov commented 4 years ago

Hi! In app.module.ts, try adding this in imports along with corresponding imports in above

import { BrowserModule, HammerGestureConfig, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    BrowserModule,
    BrowserAnimationsModule,
webbwangatgmaildotcom commented 4 years ago

it worked! thanks!

IvanJasenov commented 4 years ago

At ease! Glad to hear so.