Last active
December 26, 2015 04:19
-
-
Save mhevery/7092098 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When you go to bleeding edge you should change to: | |
@NgController { | |
selector: '[ng-controller=AppointmentCtrl]', | |
publishAs: 'ctrl' | |
} | |
class AppointmentCtrl { | |
String appointmentText = ''; | |
List appointments = [{'time': '08:00', 'title': 'Wake Up'}]; | |
addAppointment() { | |
var newAppt = fromText(appointmentText); | |
appointments.add(newAppt); | |
appointmentText = ''; | |
}; | |
} | |
Then template to: | |
<div ng-controller=AppointmentCtrl> | |
<ul class="unstyled"> | |
<li ng-repeat="appt in ctrl.appointments"> | |
{{appt.time}} {{appt.title}} | |
</li> | |
</ul> | |
<form ng-submit="ctrl.addAppointment" class="form-inline"> | |
<input type="text" ng-model="ctrl.appointmentText" size="30" | |
placeholder="15:00 Learn Dart"> | |
<input class="btn-primary" type="submit" value="add"> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment