{"action":"created","issue":{"url":"https://api.github.com/repos/jcoglan/jsclass/issues/40","labels_url":"https://api.github.com/repos/jcoglan/jsclass/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/jcoglan/jsclass/issues/40/comments","events_url":"https://api.github.com/repos/jcoglan/jsclass/issues/40/events","html_url":"https://github.com/jcoglan/jsclass/issues/40","id":51203928,"number":40,"title":"Docs: Add example of using jsclass without the package manager","user":{"login":"Izhaki","id":880132,"avatar_url":"https://avatars.githubusercontent.com/u/880132?v=3","gravatar_id":"","url":"https://api.github.com/users/Izhaki","html_url":"https://github.com/Izhaki","followers_url":"https://api.github.com/users/Izhaki/followers","following_url":"https://api.github.com/users/Izhaki/following{/other_user}","gists_url":"https://api.github.com/users/Izhaki/gists{/gist_id}","starred_url":"https://api.github.com/users/Izhaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Izhaki/subscriptions","organizations_url":"https://api.github.com/users/Izhaki/orgs","repos_url":"https://api.github.com/users/Izhaki/repos","events_url":"https://api.github.com/users/Izhaki/events{/privacy}","received_events_url":"https://api.github.com/users/Izhaki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-07T01:49:44Z","updated_at":"2016-01-23T22:33:14Z","closed_at":null,"body":"I recently came across the library, searching for a js oop solution.\r\n\r\nThe library is amazing, the package manager is amazing, but the coupling between then in the docs is somewhat confusing and nearly deterred me from the whole library.\r\n\r\n# What myself and others may be after\r\n\r\nI was after a library that allows me to simply add it to the client side, and start using it.\r\n\r\nI you look at [jsface](https://github.com/tnhu/jsface), for instance, the instructions say you add:\r\n\r\n    <script src=\"jsface.js\" type=\"text/javascript\"></script>\r\n\r\nAnd then can write:\r\n\r\n    var Person = Class({\r\n      constructor: function(name, age) {\r\n        this.name = name;\r\n        this.age  = age;\r\n      },\r\n    \r\n      toString: function() {\r\n        return this.name + \"/\" + this.age;\r\n      }\r\n    });\r\n    \r\n    var person = new Person(\"Rika\", 20);\r\n    person.toString(); \r\n\r\n# What I have found\r\n\r\nNow instead, I found quite a bit of docs explaining how to use the package management.\r\n\r\nIn my case, jsclass will live with AngularJS (which has its own package management system), and I need to write around 70 classes, distributed into folder hierarchy, and for starters - the whole thing is just grunt concat to one big library. Having to wring manifast files and wrapping each class with a dependency code is quite an overkill, particularly at these early stages of the project. \r\n\r\nWhile using the package manager could be the right thing at the long run, currently I'm just after something simple like jsface.\r\n\r\n# It's really easy\r\n\r\nThe solution to my problem was super easy. And yes - I am maybe a bit daft for taking so long to work it out, but the whole discussion about the package management (and jsbuild) threw me off in the completely wrong direction.\r\n\r\nEssentially, one shall just add:\r\n\r\n         <script src=\"/libs/jsclass/core.js\"></script>\r\n\r\nAnd then write:\r\n\r\n    var Animal = new JS.Class({\r\n        initialize: function(name) {\r\n            this.name = name;\r\n        },\r\n    \r\n        speak: function(things) {\r\n            console.log( 'My name is ' + this.name + ' and I like ' + things );\r\n        }\r\n    });\r\n    \r\n    var nemo = new Animal('Nemo');    // nemo.name == \"Nemo\"\r\n    \r\n    nemo.speak('swimming');\r\n\r\nIf this example would be given in [the Getting Started guide](http://jsclass.jcoglan.com/introduction.html) it would save me about 3 hours.\r\n\r\nI really think the example above should be added - I nearly gave up the whole library because I really needed the layer of complexity the package manager involved - I only needed an oop class library. I'd assume others would share the same needs as me."},"comment":{"url":"https://api.github.com/repos/jcoglan/jsclass/issues/comments/174227507","html_url":"https://github.com/jcoglan/jsclass/issues/40#issuecomment-174227507","issue_url":"https://api.github.com/repos/jcoglan/jsclass/issues/40","id":174227507,"user":{"login":"artemrizhov","id":225472,"avatar_url":"https://avatars.githubusercontent.com/u/225472?v=3","gravatar_id":"","url":"https://api.github.com/users/artemrizhov","html_url":"https://github.com/artemrizhov","followers_url":"https://api.github.com/users/artemrizhov/followers","following_url":"https://api.github.com/users/artemrizhov/following{/other_user}","gists_url":"https://api.github.com/users/artemrizhov/gists{/gist_id}","starred_url":"https://api.github.com/users/artemrizhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artemrizhov/subscriptions","organizations_url":"https://api.github.com/users/artemrizhov/orgs","repos_url":"https://api.github.com/users/artemrizhov/repos","events_url":"https://api.github.com/users/artemrizhov/events{/privacy}","received_events_url":"https://api.github.com/users/artemrizhov/received_events","type":"User","site_admin":false},"created_at":"2016-01-23T22:33:14Z","updated_at":"2016-01-23T22:33:14Z","body":"+1"}}