Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass in pre-populated model #25

Closed
sclearion opened this issue May 31, 2015 · 6 comments
Closed

Cannot pass in pre-populated model #25

sclearion opened this issue May 31, 2015 · 6 comments
Assignees
Labels
Milestone

Comments

@sclearion
Copy link

Creating a post with the my new tagging input works fine but when passing in a pre-populated $scope.model, like when updating a post, the tag input shows the comma-separated tag correctly. However when you click to add more tags, the pre-set tags do not appear in the "selected items" modal list. I'm using sample hard-coded data to make sure the data is consistent but still getting same result. using latest build

UPDATE I noticed that after selecting tags, the tag object from component has an added $$hashKey parameter that I am not saving or passing back in. could this be the reason the component is not picking up my preset tags

// works fine when creating posts
$scope.post.tags = [];

// after tags are selected using the matches from callbackMethod(query), 
// the new model looks like this now. perfect! This gets saved to mongo via api and
// the new tags in the 'selected items' modal list show correctly too
$scope.post.tags = [{
    //$$hashKey: "123", im not saving this though??
    id: "126",
    name: "seagate 40726",
    user_id: "1"
},{
    //$$hashKey: "124", im not saving this though??
    id: "125",
    name: "seagate a78",
    user_id: "2"
}];

// when updating the post, passing back in the same data without $$hashKey
// does not display the tags in the 'selected items' modal list, but IT DOES show the 
// csv value in the directive form input correctly
$scope.post.tags = [{
    id: "126",
    name: "seagate 40726",
    user_id: "1"
},{
    id: "125",
    name: "seagate a78",
    user_id: "2"
}];
@guylabs guylabs self-assigned this Jun 2, 2015
@guylabs guylabs added this to the 0.2.3 milestone Jun 2, 2015
@guylabs guylabs added the bug label Jun 2, 2015
@guylabs
Copy link
Owner

guylabs commented Jun 2, 2015

Hi,

I'll have a look at the issue this week and come back to you. I never tested it with a pre populated model.

Thanks for finding the issue.

Regards,

Guy

@sclearion
Copy link
Author

Awesome thank you for this component. There is nothing else out there that does the job like this one for the ionic platform

@guylabs
Copy link
Owner

guylabs commented Jun 7, 2015

Hi,

I finally had the time to work on this issue. Can you please have a look at the model-to-item-method documentation and use it in your app and test it with the latest master changes? Can you also provide feedback if it worked then I can close the issue.

Thanks and regards,

Guy

@sclearion
Copy link
Author

Sorry for the delay, been in a troublesome sprint this week. I will try it out tonight. Thank you

@guylabs
Copy link
Owner

guylabs commented Jun 14, 2015

Hi,

any news on this?

Thanks and regards,

Guy

@sclearion
Copy link
Author

It works fine sir. Thanks you

On Sun, Jun 14, 2015 at 10:39 AM, Guy Brand [email protected]
wrote:

Hi,

any news on this?

Thanks and regards,

Guy


Reply to this email directly or view it on GitHub
#25 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants