{"action":"created","comment":{"url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/comments/34353751","id":34353751,"diff_hunk":"@@ -0,0 +1,416 @@\n+---\n+layout: post\n+title: What's new in AngularJS 1.4\n+author: cexbrayat\n+tags: [\"javascript\",\"angularjs\"]\n+---\n+\n+The new release of AngularJS has been out for a few weeks, and comes with its usual\n+lot of bug fixing (around 150) and performance improvements (digest has been boosted up).\n+Some work has been done on animations, but it's not really something I'm mastering,\n+so I'll let you dig in this part by yourself.\n+\n+The whole release has a clear feeling of getting us closer to what an app will\n+look in Angular 2, by enforcing some practices. The sad part is that the new\n+router module that was announced is not in 1.4 ans is delayed to 1.5.\n+But some nice new features have also been added.\n+\n+Let's dig in!\n+\n+# CommonJS\n+\n+For all the fans of NPM out there, AngularJS and its modules are now packaged as\n+CommonJS modules, with the proper exports, and published on NPM.\n+That allows a simpler setup if you are using Browserify.\n+\n+# limitTo\n+\n+The `limitTo` filter can now take a second argument to indicate the beginning index,\n+defaulting to 0 if not provided. If the index is negative, it will start from the end:\n+\n+    angular.module('limitToApp', [])\n+      .controller('MainCtrl', function(){\n+        this.letters = ['a', 'b', 'c', 'd', 'e', 'f'];\n+      });\n+\n+using the limit filter on `letters` will output the following:\n+\n+{%raw%}\n+    {{vm.letters | limitTo:2}} // [a, b]\n+    {{vm.letters | limitTo:2:0}} // [a, b]\n+    {{vm.letters | limitTo:2:1}} // [b, c]\n+    {{vm.letters | limitTo:2:-1}} // [f]\n+{%endraw%}\n+\n+If you want to play with it: head to this [plunkr](http://plnkr.co/edit/fjBNS27qwdZivMygQjbX?p=preview)\n+\n+# ngOptionDisable\n+\n+A very old request was the ability to disable an option in a select,\n+and there was no way to do it until this release.\n+Now, you can dynamically specify if an option should be disabled!\n+\n+Let's say you have to pick your user to pick her two favorite ponies, with two select.\n+You don't want her to pick the same one twice, so, in the second select,\n+you're gonna disable the option picked in the first one.\n+The `ngOptions` micro-syntax has been enriched with `disable when` to achieve this.\n+\n+    Most fav: <select ng-model=\"mostFav\"\n+      ng-options=\"pony for pony in ponies\">\n+    </select>\n+    Second fav: <select ng-model=\"secondFav\"\n+      ng-options=\"pony disable when isMostFav(pony) for pony in ponies\">\n+    </select>\n+\n+You can see that the second select use the new `disable` capabilities,\n+by calling a function that will check if the current option is the one chosen in the first select box.\n+You can of course also check a boolean attribute of your model instead of calling a function.\n+\n+You can test this [plunkr](http://plnkr.co/edit/axtIvHNzSgvMT99CME7S?p=preview), and pick your two favorite ponies, of course :)\n+\n+# bindToController\n+\n+A new boolean property in the directive definition object has been introduced\n+(in 1.3 actually, but I missed it), called `bindToController`, and has been improved in 1.4.\n+It implies that the directive must have a controller and that this controller\n+should have an identifier (following the 'controller as' syntax).\n+The whole point of this new attribute is to make directive scopes work better with `controllerAs`.\n+\n+Maybe you're starting to get that Angular 2 will be component oriented,\n+so every release of AngularJS 1.x will try to point us in that direction,\n+with the ultimate goal to ease the migration.\n+As Angular 2 will not use a `$scope` object anymore in the controllers, we are\n+now encouraged to write our apps using `controllerAs` (same logic applies to the new router,\n+  we'll talk about this in the following posts). With the `controllerAs` syntax in a controller,\n+  the controller is the scope itself, so you add new methods and attributes on `this`:","path":"_posts/2015-07-15-what-is-new-angularjs-1.4.md","position":85,"original_position":85,"commit_id":"5c4c9c9753ff7db7122819a803b5b64a39b9e515","original_commit_id":"5c4c9c9753ff7db7122819a803b5b64a39b9e515","user":{"login":"cexbrayat","id":411874,"avatar_url":"https://avatars.githubusercontent.com/u/411874?v=3","gravatar_id":"","url":"https://api.github.com/users/cexbrayat","html_url":"https://github.com/cexbrayat","followers_url":"https://api.github.com/users/cexbrayat/followers","following_url":"https://api.github.com/users/cexbrayat/following{/other_user}","gists_url":"https://api.github.com/users/cexbrayat/gists{/gist_id}","starred_url":"https://api.github.com/users/cexbrayat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cexbrayat/subscriptions","organizations_url":"https://api.github.com/users/cexbrayat/orgs","repos_url":"https://api.github.com/users/cexbrayat/repos","events_url":"https://api.github.com/users/cexbrayat/events{/privacy}","received_events_url":"https://api.github.com/users/cexbrayat/received_events","type":"User","site_admin":false},"body":"You're right that's badly said.","created_at":"2015-07-10T13:21:40Z","updated_at":"2015-07-10T13:21:40Z","html_url":"https://github.com/Ninja-Squad/ninja-squad.github.com/pull/139#discussion_r34353751","pull_request_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139","_links":{"self":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/comments/34353751"},"html":{"href":"https://github.com/Ninja-Squad/ninja-squad.github.com/pull/139#discussion_r34353751"},"pull_request":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139"}}},"pull_request":{"url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139","id":33656241,"html_url":"https://github.com/Ninja-Squad/ninja-squad.github.com/pull/139","diff_url":"https://github.com/Ninja-Squad/ninja-squad.github.com/pull/139.diff","patch_url":"https://github.com/Ninja-Squad/ninja-squad.github.com/pull/139.patch","issue_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/139","number":139,"state":"open","locked":false,"title":"post - ng 1.4","user":{"login":"cexbrayat","id":411874,"avatar_url":"https://avatars.githubusercontent.com/u/411874?v=3","gravatar_id":"","url":"https://api.github.com/users/cexbrayat","html_url":"https://github.com/cexbrayat","followers_url":"https://api.github.com/users/cexbrayat/followers","following_url":"https://api.github.com/users/cexbrayat/following{/other_user}","gists_url":"https://api.github.com/users/cexbrayat/gists{/gist_id}","starred_url":"https://api.github.com/users/cexbrayat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cexbrayat/subscriptions","organizations_url":"https://api.github.com/users/cexbrayat/orgs","repos_url":"https://api.github.com/users/cexbrayat/repos","events_url":"https://api.github.com/users/cexbrayat/events{/privacy}","received_events_url":"https://api.github.com/users/cexbrayat/received_events","type":"User","site_admin":false},"body":"I started to review the 1.4 release these last weeks, and I'll have a few blog posts about it (and updates to the book and the training). This is the first part, please give me your feedback.\n\nI don't know if we also should blog it in french ?","created_at":"2015-04-20T11:21:52Z","updated_at":"2015-07-10T13:21:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa15deb6e16a0c46a1ffc25144881f43557f9ad8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139/commits","review_comments_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139/comments","review_comment_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/139/comments","statuses_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/statuses/5c4c9c9753ff7db7122819a803b5b64a39b9e515","head":{"label":"Ninja-Squad:post/ng1.4-part1","ref":"post/ng1.4-part1","sha":"5c4c9c9753ff7db7122819a803b5b64a39b9e515","user":{"login":"Ninja-Squad","id":1610007,"avatar_url":"https://avatars.githubusercontent.com/u/1610007?v=3","gravatar_id":"","url":"https://api.github.com/users/Ninja-Squad","html_url":"https://github.com/Ninja-Squad","followers_url":"https://api.github.com/users/Ninja-Squad/followers","following_url":"https://api.github.com/users/Ninja-Squad/following{/other_user}","gists_url":"https://api.github.com/users/Ninja-Squad/gists{/gist_id}","starred_url":"https://api.github.com/users/Ninja-Squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ninja-Squad/subscriptions","organizations_url":"https://api.github.com/users/Ninja-Squad/orgs","repos_url":"https://api.github.com/users/Ninja-Squad/repos","events_url":"https://api.github.com/users/Ninja-Squad/events{/privacy}","received_events_url":"https://api.github.com/users/Ninja-Squad/received_events","type":"Organization","site_admin":false},"repo":{"id":5752820,"name":"ninja-squad.github.com","full_name":"Ninja-Squad/ninja-squad.github.com","owner":{"login":"Ninja-Squad","id":1610007,"avatar_url":"https://avatars.githubusercontent.com/u/1610007?v=3","gravatar_id":"","url":"https://api.github.com/users/Ninja-Squad","html_url":"https://github.com/Ninja-Squad","followers_url":"https://api.github.com/users/Ninja-Squad/followers","following_url":"https://api.github.com/users/Ninja-Squad/following{/other_user}","gists_url":"https://api.github.com/users/Ninja-Squad/gists{/gist_id}","starred_url":"https://api.github.com/users/Ninja-Squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ninja-Squad/subscriptions","organizations_url":"https://api.github.com/users/Ninja-Squad/orgs","repos_url":"https://api.github.com/users/Ninja-Squad/repos","events_url":"https://api.github.com/users/Ninja-Squad/events{/privacy}","received_events_url":"https://api.github.com/users/Ninja-Squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ninja-Squad/ninja-squad.github.com","description":"NinjaSquad's Awesome Blog ","fork":false,"url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com","forks_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/forks","keys_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/teams","hooks_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/hooks","issue_events_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/events","assignees_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/tags","blobs_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/languages","stargazers_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/stargazers","contributors_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/contributors","subscribers_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/subscribers","subscription_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/subscription","commits_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/merges","archive_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/downloads","issues_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/labels{/name}","releases_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/releases{/id}","created_at":"2012-09-10T17:11:18Z","updated_at":"2015-05-06T05:57:14Z","pushed_at":"2015-07-10T11:21:22Z","git_url":"git://github.com/Ninja-Squad/ninja-squad.github.com.git","ssh_url":"git@github.com:Ninja-Squad/ninja-squad.github.com.git","clone_url":"https://github.com/Ninja-Squad/ninja-squad.github.com.git","svn_url":"https://github.com/Ninja-Squad/ninja-squad.github.com","homepage":"blog.ninja-squad.com","size":12192,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"Ninja-Squad:master","ref":"master","sha":"08dcd8d04dcd796d1f75fbd1af9843c312c880c7","user":{"login":"Ninja-Squad","id":1610007,"avatar_url":"https://avatars.githubusercontent.com/u/1610007?v=3","gravatar_id":"","url":"https://api.github.com/users/Ninja-Squad","html_url":"https://github.com/Ninja-Squad","followers_url":"https://api.github.com/users/Ninja-Squad/followers","following_url":"https://api.github.com/users/Ninja-Squad/following{/other_user}","gists_url":"https://api.github.com/users/Ninja-Squad/gists{/gist_id}","starred_url":"https://api.github.com/users/Ninja-Squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ninja-Squad/subscriptions","organizations_url":"https://api.github.com/users/Ninja-Squad/orgs","repos_url":"https://api.github.com/users/Ninja-Squad/repos","events_url":"https://api.github.com/users/Ninja-Squad/events{/privacy}","received_events_url":"https://api.github.com/users/Ninja-Squad/received_events","type":"Organization","site_admin":false},"repo":{"id":5752820,"name":"ninja-squad.github.com","full_name":"Ninja-Squad/ninja-squad.github.com","owner":{"login":"Ninja-Squad","id":1610007,"avatar_url":"https://avatars.githubusercontent.com/u/1610007?v=3","gravatar_id":"","url":"https://api.github.com/users/Ninja-Squad","html_url":"https://github.com/Ninja-Squad","followers_url":"https://api.github.com/users/Ninja-Squad/followers","following_url":"https://api.github.com/users/Ninja-Squad/following{/other_user}","gists_url":"https://api.github.com/users/Ninja-Squad/gists{/gist_id}","starred_url":"https://api.github.com/users/Ninja-Squad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ninja-Squad/subscriptions","organizations_url":"https://api.github.com/users/Ninja-Squad/orgs","repos_url":"https://api.github.com/users/Ninja-Squad/repos","events_url":"https://api.github.com/users/Ninja-Squad/events{/privacy}","received_events_url":"https://api.github.com/users/Ninja-Squad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Ninja-Squad/ninja-squad.github.com","description":"NinjaSquad's Awesome Blog ","fork":false,"url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com","forks_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/forks","keys_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/teams","hooks_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/hooks","issue_events_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/events","assignees_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/tags","blobs_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/languages","stargazers_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/stargazers","contributors_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/contributors","subscribers_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/subscribers","subscription_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/subscription","commits_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/merges","archive_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/downloads","issues_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/labels{/name}","releases_url":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/releases{/id}","created_at":"2012-09-10T17:11:18Z","updated_at":"2015-05-06T05:57:14Z","pushed_at":"2015-07-10T11:21:22Z","git_url":"git://github.com/Ninja-Squad/ninja-squad.github.com.git","ssh_url":"git@github.com:Ninja-Squad/ninja-squad.github.com.git","clone_url":"https://github.com/Ninja-Squad/ninja-squad.github.com.git","svn_url":"https://github.com/Ninja-Squad/ninja-squad.github.com","homepage":"blog.ninja-squad.com","size":12192,"stargazers_count":2,"watchers_count":2,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139"},"html":{"href":"https://github.com/Ninja-Squad/ninja-squad.github.com/pull/139"},"issue":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/139"},"comments":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/issues/139/comments"},"review_comments":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139/comments"},"review_comment":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/pulls/139/commits"},"statuses":{"href":"https://api.github.com/repos/Ninja-Squad/ninja-squad.github.com/statuses/5c4c9c9753ff7db7122819a803b5b64a39b9e515"}}}}