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

Add a warning to readme about using model in Octane #70

Open
ijlee2 opened this issue Jan 20, 2020 · 5 comments
Open

Add a warning to readme about using model in Octane #70

ijlee2 opened this issue Jan 20, 2020 · 5 comments

Comments

@ijlee2
Copy link
Contributor

ijlee2 commented Jan 20, 2020

Hello. A couple of weeks ago, my team introduced a bug when we Octanified our templates by changing all instances of this.model to @model. We didn't realize until today that we should have left alone this.model in app/templates/head.hbs, since model refers to the head-data service.

I was wondering if you could (1) add a warning to the readme file under https://github.com/ronco/ember-cli-head#service, and (2) update the example code to Octane,

<meta property="og:title" content={{this.model.title}} />

so that other developers and teams may avoid our mistake when using Octane? I can also create a PR if you think making these changes would be a good idea.

@RobbieTheWagner
Copy link

I think we could even go a step further and not name it model to avoid confusion, but at the very least, I think we should do as @ijlee2 suggests.

@ijlee2
Copy link
Contributor Author

ijlee2 commented Jun 18, 2020

Sounds good. I can make a PR this weekend to add the warning and update the example code.

I think renaming model to a more descriptive name would be good. However, since this will cause a breaking change, it may be out of the extent of help that I can offer.

@RobbieTheWagner
Copy link

@ijlee2 yeah, I think no need to introduce a breaking change right now, but we do need to guard people against making this mistake.

@rwjblue
Copy link
Member

rwjblue commented Jun 18, 2020

Ya, we can expose a new field though. So you could author this.headData.someProperty, instead of this.model. Using model here really just isn't very useful.

@ijlee2
Copy link
Contributor Author

ijlee2 commented Jun 20, 2020

I opened the PR at #81, just for updating the readme. I suggest that we make a new issue to address the ambiguity in model.

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

No branches or pull requests

3 participants