{"action":"created","issue":{"url":"https://api.github.com/repos/astoilkov/jsblocks/issues/18","labels_url":"https://api.github.com/repos/astoilkov/jsblocks/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/astoilkov/jsblocks/issues/18/comments","events_url":"https://api.github.com/repos/astoilkov/jsblocks/issues/18/events","html_url":"https://github.com/astoilkov/jsblocks/issues/18","id":72180545,"number":18,"title":"Setting up an observable with an initial null value throws an error","user":{"login":"walterdavis","id":27033,"avatar_url":"https://avatars.githubusercontent.com/u/27033?v=3","gravatar_id":"","url":"https://api.github.com/users/walterdavis","html_url":"https://github.com/walterdavis","followers_url":"https://api.github.com/users/walterdavis/followers","following_url":"https://api.github.com/users/walterdavis/following{/other_user}","gists_url":"https://api.github.com/users/walterdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/walterdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walterdavis/subscriptions","organizations_url":"https://api.github.com/users/walterdavis/orgs","repos_url":"https://api.github.com/users/walterdavis/repos","events_url":"https://api.github.com/users/walterdavis/events{/privacy}","received_events_url":"https://api.github.com/users/walterdavis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-30T14:32:25Z","updated_at":"2015-04-30T20:18:08Z","closed_at":null,"body":"~~~js\r\n  function Model(){\r\n    this.user_input = blocks.observable();\r\n    this.headline = 'Howdy from the application';\r\n  }\r\n  blocks.query(new Model());\r\n~~~\r\n~~~html\r\n  <h1>{{headline}}</h1>\r\n  <input data-query=\"val(user_input)\" placeholder=\"Enter some text…\" size=\"40\"/> <button class=\"clear\">&times;</button>\r\n  <p>{{user_input}}</p>\r\n~~~\r\n\r\nThis works, but it throws an error unless I declare a global variable named user_input. If I put an initial value in like blocks.observable('foo'), then I don't get the error, but I also can't use a placeholder as I would like. I would like the variable to initialize to an empty string if nothing is passed into it by observable."},"comment":{"url":"https://api.github.com/repos/astoilkov/jsblocks/issues/comments/97954108","html_url":"https://github.com/astoilkov/jsblocks/issues/18#issuecomment-97954108","issue_url":"https://api.github.com/repos/astoilkov/jsblocks/issues/18","id":97954108,"user":{"login":"astoilkov","id":884810,"avatar_url":"https://avatars.githubusercontent.com/u/884810?v=3","gravatar_id":"","url":"https://api.github.com/users/astoilkov","html_url":"https://github.com/astoilkov","followers_url":"https://api.github.com/users/astoilkov/followers","following_url":"https://api.github.com/users/astoilkov/following{/other_user}","gists_url":"https://api.github.com/users/astoilkov/gists{/gist_id}","starred_url":"https://api.github.com/users/astoilkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astoilkov/subscriptions","organizations_url":"https://api.github.com/users/astoilkov/orgs","repos_url":"https://api.github.com/users/astoilkov/repos","events_url":"https://api.github.com/users/astoilkov/events{/privacy}","received_events_url":"https://api.github.com/users/astoilkov/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T20:18:08Z","updated_at":"2015-04-30T20:18:08Z","body":"I couldn't break the example when I opened it maybe its browser specific. Howerver, this does not matter a lot because you should not combine(and there is no reason to) combine `blocks.Application()` and `blocks.query()`. You should use one but now both together. What best suit your needs. The Application gives more structure to your application and the `blocks.query()` gives you more freedom."}}