Skip to content

$new does not produce any $mapping #24

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions