我的错误是
EXCEPTION: Error: Uncaught (in promise): Template parse errors:
Can't bind to 'ngFormModel' since it isn't a known native property ("
<h3 class = "head">MY PROFILE</h3>
<form [ERROR ->][ngFormModel]="form" (ngSubmit)="onSubmit(form.value)">
<div class="row">
"): a@3:7
There is no directive with "exportAs" set to "ngForm" ("stname</label>
<input type="text" id="facebook" class="form-control" ngControl="firstname" [ERROR ->]#firstname="ngForm" >
</div>
"): a@9:85
There is no directive with "exportAs" set to "ngForm" ("/label>
<input type="text" id="facebook" class="form-control col-xs-3" ngControl="lastname" [ERROR ->]#lastname="ngForm" >
</div>
Run Code Online (Sandbox Code Playgroud)
我的模板,
<h3 class="head">MY PROFILE</h3>
<form …Run Code Online (Sandbox Code Playgroud) 我想要一个表格,其中每列中都有编辑按钮,我使用了ng2,其中我没有把按钮放在最后.
我的HTML,
<ng-table [config]="config.sorting"
(tableChanged)="onChangeTable(config)"
[rows]="rows" [columns]="columns" >
</ng-table>
Run Code Online (Sandbox Code Playgroud)
我的
rows: Array<any> = [];
columns: Array<any> = [
{title: 'Name', name: 'accountname'},
{title: 'Position', name: 'email', sort: false},
{title: 'Office', name: 'phone', sort: 'asc'},
];
Run Code Online (Sandbox Code Playgroud)
但我想在每一栏都有一个按钮进行编辑和删除,我该怎么做呢,有人可以提供帮助.
我试图使用节点js读取csv文件.她是我的代码
fs.readFile(config.csvUploadPath, function read(err, data) {
if (err) {
throw err;
}
console.log(data + 'my data')
});
Run Code Online (Sandbox Code Playgroud)
安慰:
ID
D11
D33
D55
Run Code Online (Sandbox Code Playgroud)
在这里,我想获取列ID中的元素并将它们存储在数组中.我怎样才能做到这一点?谁能建议我帮忙.谢谢.我的控制器:
var partnersModel = new partners(params);
fs.readFile(config.csvUploadPath, function read(err, data) {
if (err) {
throw err;
}
dataArray = data.toString().split(/\r?\n/);
dataArray.forEach(function(v,i){
if(v !== 'DUI'){
partnersModel.dui.push(v);
}
});
});
partnersModel.save(function(error, response){
Run Code Online (Sandbox Code Playgroud) 我正在使用angular2验证我的模板,但同时它显示了这个错误:
Cannot read the property 'errors' of undefined.
Run Code Online (Sandbox Code Playgroud)
这是我的模板:
<h3 class = "head">{{title}}</h3>
<form [ngFormModel]="form" #f="ngForm">
<div class="row">
<div class="form-group">
<label class="formHeading">Facebook</label>
<input type="text" id="facebook" class="form-control col-xs-3" ngControl="facebook" #facebook="ngForm" >
</div>
<div *ngIf ="facebook.touched && facebok.errors">
<div class="form-row btn">
<button type="submit" class="btn btn-primary pull-right butspace" [disabled]="!f.valid">Save</button>
</div>
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它会显示这个错误.任何人都可以解决它?
我有3种记录,
1)Categories,
2)Topics and
3)Articles
Run Code Online (Sandbox Code Playgroud)
在我的mongodb中,我只有一个名为'categories'的集合,其中我攻击了上述3种类型的文档.
对于这3个模块,我写了3个模型(每个模型),如下所示,
mongoose.model('categories', CategorySchema);
mongoose.model('categories', TopicSchema)
mongoose.model('categories', ArticlesSchema)
Run Code Online (Sandbox Code Playgroud)
像.... mongoose.model('collection_name',Schema_name)
但是当我运行我的代码时,它会抛出错误
Cannot overwrite `categories` model once compiled.
Run Code Online (Sandbox Code Playgroud)
如果我改变上面这样的模型,
mongoose.model('category','categories', CategorySchema);
mongoose.model('topics','categories', TopicSchema)
mongoose.model('articles','categories', ArticlesSchema)
Run Code Online (Sandbox Code Playgroud)
它正在创建2个名为主题和文章的集合,我不想要它们.这是我现在的问题,任何人都可以建议我帮忙.....谢谢......
我想更新一个数组值,但我不确定正确的方法,所以我尝试了下面的方法,但没有为我工作.
我的模型,我的模型中的儿童字段
childrens: {
type: Array,
default: ''
}
Run Code Online (Sandbox Code Playgroud)
我的查询,
Employeehierarchy.update({ _id: employeeparent._id} ,{ $set: {"$push": { "childrens": employee._id }} })
.exec(function (err, managerparent) {});
Run Code Online (Sandbox Code Playgroud)
谁能请我帮忙.谢谢.
我有一个功能,我以这种方式做到了
JS:
function updateInstitution (isValid) {alert('hi')
if (!isValid) {
$scope.$broadcast('show-errors-check-validity', 'vm.form.institutionForm');
return false;
}
var data = JSON.stringify(vm.institution);
httpService.put('institutions/' + vm.institution_id, data).then(function (results) {
if (results && results.data && results.data.details) {
vm.institution = results.data.details;
formInstitutionData('profile');
commonService.showNotification('success', 'Institution Details updated successfully!');
$('#institutionModal').modal('hide');
}
});
}
}
vm.updateInstitution = updateInstitution;
Run Code Online (Sandbox Code Playgroud)
HTML:
<button type="button" class="btn btn-blue" ng-click="vm.updateInstitution(vm.form.institutionForm.$valid)" ng-bind="field.saveText"></button>
Run Code Online (Sandbox Code Playgroud)
但我得到的错误
updateInstitution is not defined
Run Code Online (Sandbox Code Playgroud)
任何人都可以提出建议。谢谢。
JS:
(function () {
'use strict';
// Institutions controller
angular
.module('institutions')
.controller('InstitutionsController', InstitutionsController);
InstitutionsController.$inject = ['$scope', '$state', '$window', '$timeout', …Run Code Online (Sandbox Code Playgroud) 我正在尝试验证我的标记,以下是我的 html 代码。当我验证它时,说错误
Error: Bad start tag in img in head.
Run Code Online (Sandbox Code Playgroud)
这些是我用来获取错误的标签
<noscript>
<img height="1" width="1" class="displaynone" src="https://www.facebook.com/tr?id=1007528252627508&ev=PageView&noscript=1">
</noscript>
Run Code Online (Sandbox Code Playgroud)
我认为错误是标签不应包含任何标签,除了 , 和 元素,但我不确定有人能找到确切的问题吗?
最近,我将我的angular2项目更新为2.0.2版本,当我使用输入标签时出现以下错误,
错误,
Uncaught (in promise): Error: Error in app/articles/articles.html:42:20 caused by:
ngModel cannot be used to register form controls with a parent formGroup directive. Try using
formGroup's partner directive "formControlName" instead. Example:
<div [formGroup]="myGroup">
<input formControlName="firstName">
</div>
In your class:
this.myGroup = new FormGroup({
firstName: new FormControl()
});
Run Code Online (Sandbox Code Playgroud)
我的模板,
<div *ngIf = 'showform'>
<form class="nobottommargin" [formGroup]="form" (ngSubmit)="onSubmit(form.value)" novalidate="novalidate">
<div class="form-process"></div>
<div class="col_full">
<label for="template-contactform-name">Title</label>
<input type="text" formControlName="articletitle" placeholder="Title" class="sm-form-control required" aria-required="true">
</div>
<div class="clear"></div>
<div class="col_full">
<label for="template-contactform-message">Description</label>
<textarea class="required …Run Code Online (Sandbox Code Playgroud)