GithubHelp home page GithubHelp logo

Comments (11)

third774 avatar third774 commented on July 19, 2024 3

@spekkie2002 - can you try installing the @next build again and see if the is fixed? Thanks!

from ng-bootstrap-form-validation.

third774 avatar third774 commented on July 19, 2024

Thanks for testing and creating the issue!

Can you please share what the exact dev build of the module this was with from your package.json file?

from ng-bootstrap-form-validation.

third774 avatar third774 commented on July 19, 2024

And maybe also what your main app module looks like?

from ng-bootstrap-form-validation.

spekkie2002 avatar spekkie2002 commented on July 19, 2024

Sure! Thanks for answering this quickly! :-)

"ng-bootstrap-form-validation": "^2.1.0-dev.20180908141610544Z.2a863f6dca92772ca67ca490f5ea48aab0917975",

app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { ToastrModule } from 'ngx-toastr';
import { NgxSpinnerModule } from 'ngx-spinner';
import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { LayoutsModule } from './shared/layouts/layouts.module';

import * as fromInterceptors from './shared/interceptors';
import { InfoService } from './shared/services/info-service.service';
import { ShortDatePipe } from './shared/pipes/short-date.pipe';

@NgModule({
  declarations: [AppComponent, ShortDatePipe],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    AppRoutingModule,
    HttpClientModule,
    LayoutsModule,
    ToastrModule.forRoot({
      positionClass: 'toast-top-md',
      enableHtml: true,
    }),
    NgxSpinnerModule,
    NgBootstrapFormValidationModule.forRoot(),
  ],
  providers: [
    InfoService,
    {
      provide: HTTP_INTERCEPTORS,
      useClass: fromInterceptors.ErrorInterceptor,
      multi: true,
    },
    {
      provide: HTTP_INTERCEPTORS,
      useClass: fromInterceptors.TokenInterceptor,
      multi: true,
    },
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}

from ng-bootstrap-form-validation.

kingcody avatar kingcody commented on July 19, 2024

@spekkie2002 I too ran into this error recently. I still haven't found a root cause, but will report back if I do.

from ng-bootstrap-form-validation.

third774 avatar third774 commented on July 19, 2024

@kingcody - looks like the | null here is causing the issue. If I remove it, I don't get the error. Any idea how we can define that type to be nullable and still resolve correctly within the DI framework? It's already being decorated with @Optional(), so I'm not sure why it's not working? 🤷‍♂️

https://github.com/third774/ng-bootstrap-form-validation/blob/master/projects/ng-bootstrap-form-validation/src/lib/Directives/form-control.directive.ts#L75

from ng-bootstrap-form-validation.

third774 avatar third774 commented on July 19, 2024

Looks like this might be related? angular/angular#25544

from ng-bootstrap-form-validation.

kingcody avatar kingcody commented on July 19, 2024

@third774 you're correct, I'm actually in the process of testing around that in my local. Technically, by default null and undefined are assignable to all types in TypeScript, so I'm not sure that typing is providing anything. Do you have any insight as to why it was included with #45 ?

from ng-bootstrap-form-validation.

third774 avatar third774 commented on July 19, 2024

Just merged this PR which should fix the issue - #49

from ng-bootstrap-form-validation.

third774 avatar third774 commented on July 19, 2024

@kingcody Ah, crap. I forgot that strictNullChecks was a compiler flag that is not on by default. Thanks.

from ng-bootstrap-form-validation.

spekkie2002 avatar spekkie2002 commented on July 19, 2024

@third774 That did the trick!

Awesome! Thanks a lot, i really appreciate it!

from ng-bootstrap-form-validation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.