{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/documentation/issues/201","repository_url":"https://api.github.com/repos/aurelia/documentation","labels_url":"https://api.github.com/repos/aurelia/documentation/issues/201/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/documentation/issues/201/comments","events_url":"https://api.github.com/repos/aurelia/documentation/issues/201/events","html_url":"https://github.com/aurelia/documentation/issues/201","id":142724283,"number":201,"title":"Api Documentation","user":{"login":"irashid25","id":16107709,"avatar_url":"https://avatars.githubusercontent.com/u/16107709?v=3","gravatar_id":"","url":"https://api.github.com/users/irashid25","html_url":"https://github.com/irashid25","followers_url":"https://api.github.com/users/irashid25/followers","following_url":"https://api.github.com/users/irashid25/following{/other_user}","gists_url":"https://api.github.com/users/irashid25/gists{/gist_id}","starred_url":"https://api.github.com/users/irashid25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irashid25/subscriptions","organizations_url":"https://api.github.com/users/irashid25/orgs","repos_url":"https://api.github.com/users/irashid25/repos","events_url":"https://api.github.com/users/irashid25/events{/privacy}","received_events_url":"https://api.github.com/users/irashid25/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-22T17:40:38Z","updated_at":"2016-03-22T18:16:08Z","closed_at":null,"body":"Hi all,\r\n\r\nI've recently started to develop an app using aurelia and am looking to learn and understand the framework from the ground up.\r\n\r\nWhile i know the framework is in beta, does anyone have any idea when the Api(library) documentation will be updated with examples on how to use them.\r\n\r\nFor example, If you look at the addRoute method on the router class\r\naddRoute\r\n(\r\nconfig: RouteConfig\r\nnavModel: NavModel\r\n): void \r\n\r\nParameters:\r\n\r\nconfig: RouteConfig\r\nThe [[RouteConfig]].\r\nnavModel: NavModel\r\nThe [[NavModel]] to use for the route. May be omitted for single-pattern routes.\r\n\r\nAnd that's all there is. It would be so much beneficial if there was also an example on how to use this, especially for new aurelia developers like myself. Unless there is documentation that i have missed, the developer in some cases will have to search online for practical examples of how the method is used. Looking at the above someone could ask, what exactly is a routeconfig? What properties does it have if its an object etc.\r\n\r\nContrast this to msdn documentation (yes i know, it's taken along time in the making).\r\nDatetime compare example: \r\nhttps://msdn.microsoft.com/en-us/library/system.datetime.compare(v=vs.110).aspx\r\n\r\nIt gives you an overview of the method just like the aurelia docs, but then it gives an example on how it should be used including additional information that will be useful to the developer. I dont need to search anywhere else on how this method is used. All i have to figure out is where the best place is to use it.\r\n\r\nThe team may already have plans to do something like this, but it would be nice to have an update as to whether this is being looked at. I feel for developers it would be really useful as it would allow them to learn the framework themselves rather than trawling stackoverflow for answers to common tasks. \r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/aurelia/documentation/issues/comments/199947627","html_url":"https://github.com/aurelia/documentation/issues/201#issuecomment-199947627","issue_url":"https://api.github.com/repos/aurelia/documentation/issues/201","id":199947627,"user":{"login":"irashid25","id":16107709,"avatar_url":"https://avatars.githubusercontent.com/u/16107709?v=3","gravatar_id":"","url":"https://api.github.com/users/irashid25","html_url":"https://github.com/irashid25","followers_url":"https://api.github.com/users/irashid25/followers","following_url":"https://api.github.com/users/irashid25/following{/other_user}","gists_url":"https://api.github.com/users/irashid25/gists{/gist_id}","starred_url":"https://api.github.com/users/irashid25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irashid25/subscriptions","organizations_url":"https://api.github.com/users/irashid25/orgs","repos_url":"https://api.github.com/users/irashid25/repos","events_url":"https://api.github.com/users/irashid25/events{/privacy}","received_events_url":"https://api.github.com/users/irashid25/received_events","type":"User","site_admin":false},"created_at":"2016-03-22T18:16:08Z","updated_at":"2016-03-22T18:16:08Z","body":"Thanks for the super quick reply rob.\r\n\r\nI have just done a ctrl f on the following page and did not find an example of the addroute method.\r\nhttp://aurelia.io/docs.html#/aurelia/framework/1.0.0-beta.1.1.4/doc/article/cheat-sheet\r\n\r\nAnother issue i came across that helps me make my point is the following:\r\n\r\nYesterday i was just playing around and made 2 buttons that redirected a user to the signup view and the login view. On the click handlers (methods in the js file) i tried the new redirect method/class to navigate the user to the correct view. It didn't work. I looked at the api docs and like i described above it was just an overview. Then i looked at the cheatsheet and the only real example i could find was the following:\r\n\r\nreturn next.cancel(new Redirect('login')); (found in the customizing the navigationpipeline section). \r\nIn the end, after searching stackoverflow and github forums i was able to achieve my objection by doing the following:\r\n\r\nimport {Aurelia, inject} from 'aurelia-framework';\r\n@inject(Aurelia)\r\nexport class Welcome{\r\n    constructor(aurelia){\r\n        this.aurelia = aurelia;\r\n    }\r\n    \r\n    login(){\r\n        this.aurelia.setRoot('pathtojsfile');\r\n    }\r\n    \r\n    signup(){\r\n        this.aurelia.setRoot('pathtojsfile');\r\n    }\r\n}\r\n\r\nthe welcome view is the default view that i load using the configure method.\r\nexport function configure(aurelia) {\r\n    // here you can configure any optional plugins\r\n    aurelia.use\r\n           .standardConfiguration()\r\n           .developmentLogging();\r\n           \r\n    // Set the default component to load (if none is provided it will load app.js)\r\n    aurelia.start().then(a => a.setRoot('welcome/welcome'));\r\n\r\n};\r\n\r\nMy point is, i don't know why using the new redirect method didn't work in my situation and why the setRoot did. I feel if the documentation was a bit more complete it would really help new JavaScript developers, like myself, understanding the framework much easier. Apologies if i sound like I'm wanting to be spoon fed, but as a .net developer who uses the msdn documentation on a regular basis, i feel the documentation is a bit lacking for non JavaScript developers in terms of examples. That being said, comparing the docs to something like Angular, the docs are very very good and excellent for someone to get started.\r\n\r\nThanks.\r\n"}}