I'm creating a new app with knockout and i'm having a very weird error. I use knockout for a while and never had this error before.

Whenever I try to use the "$root." pseudoselector, knockout returns me:

```
Uncaught SyntaxError: Unable to parse bindings.
Bindings value: click: .createAlarm
Message: Unexpected token . 

```

In this case, the binding was:

```
<button class='btn' data-bind='click: $root.createAlarm'>New alarm</button>

```

The same thing happened when I tried to reference a viewmodel function inside a foreach binding.

Here's my code:

```
function ViewModel() {
                var self = this;
                // data
                // set initial time for alarm
                self.alarmHour = ko.observable(moment().hours());
                self.alarmMinute = ko.observable(moment().minutes());
                self.alarmSecond = ko.observable(moment().seconds());
                self.chosenAlarmTrack = ko.observable();
                self.alarms = ko.observableArray();

                // methods

                self.createAlarm = function() {
                    var timeNow = moment()
                    var alarmTime = getNewTime(self.alarmHour(), self.alarmMinute(), self.alarmSecond());
                    var alarmTime = moment(alarmTime)

                    if (timeNow.isAfter(alarmTime)) {
                        alarmTime.add(1, "day");
                    }

                    self.alarms.push(new Alarm(alarmTime, self.chosenAlarmTrack()))
                }

            }

            $(document).ready(function() {
                var vm = new ViewModel();
                ko.applyBindings(vm);
            })

```