Skip to content

继承问题 #2

@memotail

Description

@memotail

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注释掉, 就没问题了。
你看下代码是不是存在这个问题?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions