Closed nevf closed 10 years ago
Hi Neville,
This is actually expected behavior. I did this because its usually left up to a template engine to display initial values. I was thinking about adding GDB.render()
method which would explicitly put data into the corresponding elements. Perhaps I can even optionally allow GDB to initialize in this way. Would you like this? Also, it seems you deleted your other post. Were you able to fix that problem?
Hi John, Because your examples initialize model property values, I assumed these would be rendered. It does seem confusing that this isn't the case and means the model and dom have different values.
An option makes sense and I'd default it to true, as I can't see why you wouldn't want this behaviour, can you?
Yes the other issue resolved itself! I've just started writing a Browser Extension for my app Clibu and this seemed like a good opportunity to use GDB. Testing Browser Extensions seems a bit flakey at times and I put the deleted issue down to that.
Hi Neville,
I agree and I will try to add this feature by the end of tomorrow. I will also add a GDB.render()
as well in the case of dynamically added content since there's no effective way to check when the DOM is changed.
Hi John, Sounds good. I'm in no hurry.
I'm going to update this readme with the new features and then commit the changes shortly.
Updated.
@JohnLouderback With the following code:
I'm not seeing: "Ms. Trunchbull" displayed in the
input
element. If I uncommentmodel.name = 'Nifty Neville';
then 'Nifty Neville' is displayed.Further when I type in the
input
field I see the console.log output from:modelChangeCallback()
-Neville