You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we simplify and not use getters and setters from PirateName to the controller fields?
class BadgesController {
// ...
String get name => _name._firstName;
set name(String value) {
_name = new PirateName(firstName: value);
}
String get pirateName => _name.pirateName;
// ...
}
could just be:
class BadgesController {
PirateName pirateName;
}
The version in the code lab looks too verbose :(
Thoughts?
The text was updated successfully, but these errors were encountered:
I just tried to change this but this implies some modifications in PirateName ( a firstName getter and a firstName setter ) and in the binding in the html file that do not really simplify :
I think it's OK to differ from the original, if it makes sense. I'm worried that we made a controller that is also acting like a model. I think it's ok to have a binding expression like ctrl.pirateName.firstName
I'm also worried people will think we built a system like Java, with all the getters.
Can we simplify and not use getters and setters from PirateName to the controller fields?
could just be:
The version in the code lab looks too verbose :(
Thoughts?
The text was updated successfully, but these errors were encountered: