我正在阅读ng-bookAngular 5上的Ari Lerner .我正在使用ngx-bootstrap和Bootstrap 4.表格验证似乎没有像勒纳先生那样实施.我不确定这是否是一个限制ngx-bootstrap...任何人都知道?
编辑
好的,我删除了ngx-bootstrap,只是加载了MaxCDNs Bootstrap 4,我有同样的问题.错误消息未出现.
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { RegistrationFormComponent } from './registration-form/registration-form.component';
import {
FormsModule,
ReactiveFormsModule,
FormBuilder,
FormGroup
} from '@angular/forms';
@NgModule({
declarations: [
AppComponent,
NavbarComponent,
RegistrationFormComponent
],
imports: [
BrowserModule,
FormsModule,
ReactiveFormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class …Run Code Online (Sandbox Code Playgroud) 是否可以为ngx-bootstrap datepicker全局配置日期格式?
说明文档中提到的BsDatepickerConfig类,以及如何将它传递给每一个人日期选择器了,但是我有点惊讶,似乎有在全球范围内没有可能的配置(至少没有记录)
https://valor-software.com/ngx-bootstrap/#/datepicker#bs-datepicker-config
我正在尝试使用我的angualar 6项目添加Datatables插件(datatables.net)工具.我不知道如何使用npm安装程序将必要的css,js和其他必需文件包含到我的项目中.选择我必要的选项后,我遵循NPM Install方法:
npm install --save datatables.net-bs4
npm install --save datatables.net-buttons-bs4
npm install --save datatables.net-colreorder-bs4
npm install --save datatables.net-responsive-bs4
npm install --save datatables.net-rowgroup-bs4
npm install --save datatables.net-scroller-bs4
Run Code Online (Sandbox Code Playgroud)
安装后,我不确定如何在我的项目中使用这些.我的项目使用ngx-bootstrap(https://www.npmjs.com/package/ngx-bootstrap)进行样式设计.
style.scss // where I am only importing my css theme from node_modules
Run Code Online (Sandbox Code Playgroud)
在ngx-bootstrap中,样式是组件明智的,我很容易使用它们.那么,我如何将数据表功能用作组件?换句话说,我应该在哪里包含css和必需的js文件来实现页面上的数据表设施?
如果有人这样做,请告诉我,否则任何建议将不胜感激.
谢谢.
这是一个在stackblitz中的空白角度7项目,在Angular 6中使用,constructor(private bsModalRef: BsModalRef)所以我可以将值传递给我的子弹出组件.
但当我更新到角7时,它说Module not found: Error: Can't resolve 'ngx-bootstrap/modal/bs-modal-ref.service'.
在stackblitz中,它要求我安装ngx-bootstrap,但我已经安装了.
任何的想法?
将 timepicker 模块与所有默认选项一起使用,但 minutestep 设置为 1。
代码行如下
let DailyStartTime = this.dailyStartTime != null ?
new Date(this.dailyStartTime.getFullYear(),
this.dailyStartTime.getMonth(),
this.dailyStartTime.getDate(),
this.dailyStartTime.getHours(),
this.dailyStartTime.getMinutes()) : null
Run Code Online (Sandbox Code Playgroud)
将数据记录为 2017 年 5 月 31 日星期三 19:51:00 GMT-0400(东部夏令时间)
它最初显示,但一旦保存回 SQL,它就会转换为“2017-05-31T23:51:00”,它按时间偏移量推进。我怎么能否定这个?
当我创建一个 SeleccionServicioComponentMD 模态窗口(子)时,我是这样使用的:https : //valor-software.com/ngx-bootstrap/#/modals#service-component
里面的孩子有按钮。当它被点击时:
1) 父母应该关闭这个孩子。
2)父级应该显示另一个模态。
我的尝试:子项(模态)向其父项发出事件,但是:
3)父项<app-seleccion-servicio-component>在其 HTML 中没有包含标记,因为其子项是动态创建的。那么,父级在哪里侦听其子级发出的这个事件?
预期的结果是:
4)点击子组件内部的按钮。
5) 父级关闭这个子级(模态窗口)。
6) 父级显示另一个模态窗口。
7)我被困在这一点上。我不知道该怎么做才能让父级侦听其父级发出的没有<app-seleccion-servicio-component>标记的事件。
我有两个带有 ngx-bootstrap 的标签,如下所示,我想以编程方式停止标签功能 rom 工作:
<tabset>
<tab heading="First">Tab 1 content</tab>
<tab heading="Second">Tab 2 content</tab>
</tabset>
<label>Edit in progress: </label>
<input type="checkbox" [(ngModel)]="isTabSwitchEnabled">
Run Code Online (Sandbox Code Playgroud)
基本上,如果我在Tab 1 中有一个脏表单,我想弹出一个“放弃更改?” 在允许用户“导航”到Tab 2之前的对话框。我在 ngx-bootstrap tabs API 上没有看到我可以使用的任何内容。
我有一个示例Stackblitz,我尝试[disabled]在选项卡上使用它,它可以部分工作,但不能完全工作,因为我无法以编程方式设置选项卡处于活动状态(或者我不知道如何):
export class MyComponent {
disableSwitching: boolean;
@ViewChild('tabset') tabset: TabsetComponent;
@ViewChild('first') first: TabDirective;
@ViewChild('second') second: TabDirective;
confirmTabSwitch($event) {
if (this.disableSwitching) {
const confirm = window.confirm('Discard changes and switch tab?');
if (confirm) {
this.disableSwitching = false;
this.second.active = true;
}
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 ngx-bootstrap-modal 将数据从模态服务传递到模态组件中。该例子表明这一点:
this.modalService.show(ModalContentComponent, {initialState});
Run Code Online (Sandbox Code Playgroud)
但它没有显示ModalContentComponent实际如何消耗该状态。我在调试器中玩过,我从来没有看到我的组件获得这些数据。
如何从组件访问它?
我正在使用 angular 6 和 ngx-bootstrap 3.0.1
我显示一个模态,当用户在更新表单后尝试关闭模态时,我希望能够显示丢弃/取消确认。
当用户使用我的自定义关闭按钮时我没有问题,但是当他在模式外使用背景单击时我不知道如何调用我的关闭函数。
如何干净地处理背景点击以显示我的确认消息?
我正在使用 Angx-bootstrap 的 Angular 8 和 5.3.2 版本,我会实现一个导航栏,但是对于添加的每个 ngx-bootstrap 模块,我都遇到了“NullInjectorError: StaticInjectorError(BootModule)”问题
应用程序组件.html
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" (click)="isCollapsed = !isCollapsed" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="collapse navbar-collapse" [collapse]=isCollapsed>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
<li class="dropdown" dropdown>
<a href="#" dropdownToggle class="dropdown-toggle">Dropdown <span class="caret"></span></a>
<ul *dropdownMenu class="dropdown-menu" role="menu">
<li role="menuitem"><a class="dropdown-item" href="#">Action</a></li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown" dropdown>
<a …Run Code Online (Sandbox Code Playgroud) ngx-bootstrap ×10
angular ×7
typescript ×2
angular5 ×1
angular7 ×1
angular8 ×1
bootstrap-4 ×1
datatables ×1
modal-dialog ×1
tabs ×1