Closed zoltanbedi closed 7 years ago
Hmm that's a good question. Actually I think the plugin should give you a warning or at least handle the case somehow. I'll take a look at it next week, but we will definitely do something about it. Thanks for reporting
I thought about how we should go about this. Your proposed solution to change the predefined keys to be omitted if a bindable with the same name exists, sounds a bit contraproductive as it would disable the opportunity to do exactly what they're supposed to do. In most cases I do feel that a simple renaming/aliasing of your bindable should solve your issue. So what we could do instead is log a warning that a bindable has been detected using one of the reserved names. That would at least give you a hint on how to work around the issue. What do you think about this approach @B3zo0 ?
Here's a small example of how it would look like:
The bug you have there sounds a little bit different though. Could you create a small example and upload it somewhere, so that I can take a look at it?
Hi @zewa666! I did rename my property so it won't cause error. I like that warning, I think it would make sense to print it if a property which is one of the reserved word can be found in the element. To be honest it was my fault because I didn't read the doc carefully it says that it is a reserved name. I'll create a gist later.
Yep thats the way to do it, only show the warning if the key is one of the reserved words. I'll create a PR in a min for that
@B3zo0 the recently released version should fix this issue.
I'm submitting a bug report
Please tell us about your environment:
Operating System: Windows 10
Node Version: 7.9.0
NPM Version: 4.2.0
JSPM OR Webpack AND Version webpack 2.5.1
Browser: Chrome 58.0.3029.110 (64-bit)
Current behavior: I have a custom element which has a bindable called text. I want to use the T attribute to localize this text like this:
t="[text]Profile-Security"
but aurelia fails to start with this error:ERROR [app-router] HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method.
I saw in the I18N.prototype.updateValue function that text is a special string. Can you please change the implementation that if the value contains text then not to use the text case in the switch? Or is this confusing?Expected/desired behavior:
What is the expected behavior? The expected behavior is to use a property called text for the localization.
What is the motivation / use case for changing the behavior?