Skip to content

$new does not produce any $mapping #24

@ee0pdt

Description

@ee0pdt

I am creating a CRUD interface using ModelCore, the save method failed on Create because the $new method does not create the required mapping for the $toObject method. I fixed the problem in my app by copying the mapping from the parent object:

  $scope.posts = new Posts();
  $scope.newPost = $scope.posts.$new();

  $scope.posts.$find().success(function() {
    $scope.newPost.$mapping = $scope.posts.$dataset[0].$mapping;
  });

I'm not sure if there is a better way of doing this?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions