angular-cn / ng-nice Goto Github PK
View Code? Open in Web Editor NEWNgNice Web Site http://ngnice.com
License: MIT License
NgNice Web Site http://ngnice.com
License: MIT License
http://ngnice.com/ 访问不了了。。
我怎么找ng,把他引入我的工程
this.add = function (name, email, password, callback) {
var salt = kits.utils.short_guid();
var db_password = kits.utils.md5(password + salt);
var user = new this.model({
id : kits.utils.short_guid(),
name : name,
email : email,
password: db_password,
salt : salt,
role : constant.user.role.supper_admin
});
user.save(function (err) {
return callback(err);
});
};
这个数据键名 role : constant.user.role.supper_admin
role : kits.constant.user.role.supper_admin
少了个kits对象
https://github.com/angular-cn/ng-nice/blob/master/core/data/base.js#L12
在base里面定义了self = this;
get_list_age 则直接使用self,会出现个问题
post、user都继承于base,导致最后获取post列表时候,里面的self.model使用了user的。
初步认为,post、user 使用同一个base为原型,在base原型里面保存self,导致共用一套的原型最后保存的model为user的。
然后,我就在get_list_page方法里面定义var self = this;最外面保存的self注释掉, 就没问题了。
你看下代码是不是存在这个问题?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.