javascript - Knockout unexpected identifier "." -
I am creating a new app with knockout and I am having a very strange error. I use the knockout for a while and never had this error before. Every time I try to use "$ root". Pseudoselector returns to knockout: Unwanted syntax error: Unable to parse binding Binding value: Click: .createAlarm message: Unexpected token This case In, was compulsive: & lt; Button class = 'btn' data-bind = 'click: $ root.createAlarm' & gt; New alarm & lt; / Button & gt; The same thing happened when I tried to refer to a view model function inside a foreach binding. Here is my code: View function mode () {var itself = this; Set the initial time for // data // alarm itself. Bell = helm (moment (hour) (hours); Self. Alarmminute = K. Horsele (moment (.) Minute ()); Self.alarmSecond = ko.observable (moment (.) Seconds ()); Self.chosenAlarmTrack = ko.observable (); Self.alarms = ko.observableArray (); // methods themselves .createAlarm = function () ...