Questions tagged [ng-bootstrap]

A set of Angular 2+ directives based on version 4+ of Twitter Bootstrap's markup and CSS.

enter image description here

ng-bootstrap is a set of directives based on version 4+ of Twitter Bootstrap's markup and CSS.

This project was created by the angular-ui team, the same people who are behind the widely popular set of Bootstrap-powered directives for AngularJS 1.x.

The goal is to provide native Angular directives without any dependency on jQuery or Bootstrap's JavaScript. It is often better to rewrite an existing JavaScript code and create a new, pure Angular directive. Most of the time the resulting directive is smaller as compared to the original JavaScript code size and better integrated into the Angular ecosystem.

Currently supported directives are:

1703 questions
10
votes
1 answer

Is it possible to obtain a templateRef from a string?

I am interested how you can obtain a TemplateRef by passing a string for example. I don't want to obtain it through a component html, as I just want to save it in a config to be used for all components. I am refering to the ng-bootstrap…
apeshev
  • 197
  • 1
  • 6
9
votes
1 answer

How can I start the calendar week in ng bootstrap Datepicker from Sunday instead of Monday?

I want to set the ngbDatepicker to begin the week on Sunday instead of the default day Monday. I am trying to use weekStartsOn="0" but it has no effect. This is my html code
Jake Neumann
  • 372
  • 4
  • 13
9
votes
3 answers

Cannot use Ng-bootstrap in Angular 9

I started my first project in angular with ng-bootstrap and followed the installation procedure, but nevertheless It doesn't work. The message is "Uncaught Error: It looks like your application or one of its dependencies is using i18n. Angular 9…
9
votes
2 answers

Bootstrap SCSS error after angular update

I have recently upgraded my project from angular version 7 to 8. But when I issue command npm start I am seeing a lot of warnings like the following related with Bootstrap. WARNING: You probably don't mean to use the color value gray in…
9
votes
2 answers

How to open a component from lazy loaded module in NgbModal?

I am facing a problem while trying to load a dynamic component from a lazy loaded module. More precisely, I am trying to open login component in a modal (https://ng-bootstrap.github.io/#/components/modal/examples) rather then in a separate page…
Abdul Muiz
  • 111
  • 3
  • 7
9
votes
1 answer

Mock NgbModal in Angular

I need to mock a NgbModal to do some unit tests in angular, but I have no idea how to do this. This is my function: openModal(deviceID: string, productID: string){ const modalRef = this.modalService.open(ProductModal) …
Daria Domagała
  • 703
  • 1
  • 6
  • 7
9
votes
1 answer

Angular 2: NgbModal transclude in view

Let's say i have such modal template: and i'm calling this modal from another…
brabertaser19
  • 5,678
  • 16
  • 78
  • 184
9
votes
1 answer

ngBootstrap for Angular 4 DatePicker in a Reactive Form is Always Required

Using a reactive form I've added the ngbDatePicker:
mtpultz
  • 17,267
  • 22
  • 122
  • 201
9
votes
2 answers

Nesting ng-bootstrap tabs (Angular 2)

I'm trying to nest a ng-bootstrap tab widget, but the content of the nested tab isn't shown properly. The moment I click on a nested tab, the content itself disappears. Minimal demo What am I doing wrong? This is the view code: …
alexandernst
  • 14,352
  • 22
  • 97
  • 197
9
votes
3 answers

"Unexpected token import" error with Angular4 + Universal + ng-bootstrap

So I upgraded to angular 4+ just so that I can leverage the universal package for server side rendering for SEO purposes. I implemented that in my existing angular 2+ project by upgrading it to angular 4+ and did all the necessary configuration from…
ggoyal
  • 150
  • 1
  • 6
9
votes
4 answers

Event emitter from bootstrap modal to parent

I want to pass a modal event from the modal component to the modal's parent component, but for some reason I can't seem to get the EventEmitter to work. If anyone has an idea it would be greatly appreciated. The main code is below, a (non-working)…
Neph
  • 399
  • 1
  • 4
  • 10
8
votes
2 answers

Angular TextArea behavior bind to Ctrl-Enter Key

I've been trying to implement a custom