{"id":192,"date":"2014-07-21T15:18:25","date_gmt":"2014-07-21T15:18:25","guid":{"rendered":"http:\/\/www.minotaurdesign.com\/blog\/?p=192"},"modified":"2014-07-21T15:18:25","modified_gmt":"2014-07-21T15:18:25","slug":"notes-codestock-2014%e2%80%b2s-angular-awesome-presentation","status":"publish","type":"post","link":"https:\/\/www.minotaurdesign.com\/blog\/2014\/07\/21\/notes-codestock-2014%e2%80%b2s-angular-awesome-presentation\/","title":{"rendered":"Notes from CodeStock 2014\u2032s \u201cAngular Is Awesome\u201d presentation"},"content":{"rendered":"<p>Josh walked us through building a simple Angular app, using the lessons learned from Wintellect&#8217;s recent dev and launch of a global enterprise software app.  <\/p>\n<p><strong>Angular is for AWESOME!<\/strong><br \/>\nJosh Carroll<br \/>\n<a href=\"https:\/\/twitter.com\/@jwcarroll\" target=\"_blank\">@jwcarroll<\/a><br \/>\n<a href=\"http:\/\/technofattie.com\" target=\"_blank\">technofattie.com<br \/>\n<\/a><br \/>\n<strong>The code<\/strong><br \/>\n<a href=\"http:\/\/github.com\/jwcarroll.ng-contacts\" target=\"_blank\">github.com\/jwcarroll.ng-contacts<\/a><br \/>\n<strong><br \/>\ndirectives &#8211; typically an attribute on an element<\/strong><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\nng-app<br \/>\nng-init (used to inject a title in his demo)<br \/>\n\t&#8211; ng-init=&#8221;contacts=[bob1,bob2,bob3]&#8221;<br \/>\n\t&#8211; plugged it in with {{title}}<br \/>\nng-model<br \/>\n\t&#8211; he bound an input to the &#8216;title&#8217; var he had leveraged in the injected title<br \/>\n\t&#8211; ng-model=&#8217;title&#8217;<br \/>\nng-repeat<br \/>\n\t-ng-repeat=&#8221;contact in contacts&#8221;>{{contact}}<br \/>\nng-search<br \/>\n\t&#8211; &#8220;searching by &#8216;{{search}}'&#8221;<br \/>\nng-if<br \/>\n\t&#8211; truthy comparison results in rendering the stuff<br \/>\n\t&#8211; empty string resolves to 0 so nothing would render<\/p>\n<p>ng-controller &#8211; find the controller, and hand off DOM control to the controller by adding ng-controller to an element (ie a containing element)<br \/>\n\t&#8211; ng-controller contactListCtrl as ctrl (do a one time all inclusive effort to make $scope aware of all your controller&#8217;s functionality)<\/p>\n<p>ng-view (a new html tag by virtue of angular)<br \/>\n\t&#8211; ala <ng-view><\/ng-view><\/p>\n<p>ng-animate &#8211; a way to harness css3 animations<\/p>\n<p><strong>General<\/strong><br \/>\npipes (|) are filters. (think gulp)<br \/>\n&#8211; takes in something and returns something<br \/>\n&#8211; example was var AgeFilter (which returned a function as the filter)<\/p>\n<p>$http as a param passed to function<br \/>\n\t&#8211; this.$http.prop etc.<br \/>\n\t&#8211; _this.$http.get(){<br \/>\n\t\t.success(callback) \/\/this is a promise<br \/>\n\t}<br \/>\n\t&#8211; same for delete, etc<\/p>\n<p><strong>Modules<\/strong><br \/>\n&#8211; used an IFFE function<br \/>\n&#8211; a module is a container holding the stuff related to the application<\/p>\n<p>Controllers &#8211; just a JS object<br \/>\n$inject = a way to tell NG you need a component (used with $scope)<br \/>\n\t&#8211; $scope being where the data binding happens<\/p>\n<p>Lodash (_. prefix)<\/p>\n<p><strong>Services<\/strong><br \/>\n&#8211; must register a service<br \/>\n&#8211; can inject a service into a controller<\/p>\n<p><strong>Routing<\/strong><br \/>\n&#8211; ngRoute (out of the box routing within angular)<br \/>\n&#8211; colon (:) is a routing parameter<br \/>\n\t&#8211; as in \/contact\/:contactId?<br \/>\n&#8211; routing as SPA method.. each route can be passed a different controllers (essentially a path-specific template) etc. <\/p>\n<p><strong>Handling when a route fails <\/strong>(ie error handling)<br \/>\n&#8211; he made a new js file: routeError.js (again, directive is a new html tag)<br \/>\n&#8211; which contained a new directive<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Josh walked us through building a simple Angular app, using the lessons learned from Wintellect&#8217;s recent dev and launch of a global enterprise software app. Angular is for AWESOME! Josh Carroll @jwcarroll technofattie.com The code github.com\/jwcarroll.ng-contacts directives &#8211; typically an attribute on an element &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- ng-app ng-init (used to inject a title in his demo) &hellip; <a href=\"https:\/\/www.minotaurdesign.com\/blog\/2014\/07\/21\/notes-codestock-2014%e2%80%b2s-angular-awesome-presentation\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Notes from CodeStock 2014\u2032s \u201cAngular Is Awesome\u201d presentation<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,17],"tags":[41,42,37,35,40,39,38],"_links":{"self":[{"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/posts\/192"}],"collection":[{"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/comments?post=192"}],"version-history":[{"count":1,"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/posts\/192\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/posts\/192\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/media?parent=192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/categories?post=192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.minotaurdesign.com\/blog\/wp-json\/wp\/v2\/tags?post=192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}