如何在toastr中显示多行错误信息?
我已经格式化了如下所示的错误消息
"Please fix the following: \r\nFirst Name is required\r\nLast Name is required\r\nEmail Address is required\r\n"
Run Code Online (Sandbox Code Playgroud)
但在toasrt中它显示在单行中.请帮忙
我有一个字段,我在模型中声明为字符串,如下所示:
App.Student= DS.Model.extend({
name: DS.attr('string'),
address1: DS.attr('string'),
address2: DS.attr('string'),
city: DS.attr('string'),
state: DS.attr('string'),
postal: DS.attr('string'),
country: DS.attr('string'),
});
Run Code Online (Sandbox Code Playgroud)
在编辑模式下,当我将Adderess 2字段更新为null时,则出现以下错误:
"Failed to edit property: One or more parameter values were invalid: An AttributeValue may not contain an empty string"
我知道这个错误是生成的,因为我将地址2字段更新为null并且我想要的地址2字段不是必需的(可以传递数据或者也可以将该列保留为空白")
我想要一个仅在选中一组复选框中的一个时才启用的按钮,类似于http://jsfiddle.net/chriscoyier/BPhZe/76中的小提琴:
var checkboxes = $("input[type='checkbox']"),
submitButt = $("input[type='submit']");
checkboxes.click(function() {
submitButt.attr("disabled", !checkboxes.is(":checked"));
});
Run Code Online (Sandbox Code Playgroud)
我想用AngularJs来实现它.
父组件
import { Component } from '@angular/core';
import { ChildComponent } from './notify.component';
@Component({
selector: 'my-app',
template:
`
<button (click)="submit()">Call Child Component Method</button>
`
})
export class AppComponent {
constructor(private childComp: ChildComponent) {
}
submit(): void {
// execute child component method
// This line is compiled properly but at the run time it gives me error related to the static injector## Heading ##
childComp.callMethod();
}
}
Run Code Online (Sandbox Code Playgroud)
子组件
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'child',
template: '<h3>Child …Run Code Online (Sandbox Code Playgroud)