Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Angular JS Introduction

Angular JS Introduction

Slides for AngularJS Introduction talk presented by me.

Dhyego Fernando

May 06, 2015
Tweet

More Decks by Dhyego Fernando

Other Decks in Technology

Transcript

  1. model module bootstrap template expression <div ng-app> <div> <label>Name:</label> <input

    type="text" ng-model="yourName"> <hr> <h1>Hello {{yourName}}!</h1> </div> </div>
  2. module application dependency injection ... service 3rd's module service angular.module('app',

    ['alerter']) .controller('GreetingController', function($scope, Alerter) { $scope.name = 'John Doe'; $scope.greet = function() { Alerter.show('Hello ' + $scope.name); }; }); angular.module('alerter', []) .factory('Alerter', function($window) { return { show: function(string) { $window.alert(string); } }; });
  3. Non-semantic way bootstrap plugin element <div id="tab"> <ul class="tab-head"> <li><a

    href="#content-1">Title 1</a></li> <li><a href="#content-2">Title 2</a></li> <li><a href="#content-3">Title 3</a></li> </ul> <div id="content-1" class="tab-content"> <p>Content 1 goes here</p> </div> <div id="content-2" class="tab-content"> <p>Content 2 goes here</p> </div> <div id="content-3" class="tab-content"> <p>Content 3 goes here</p> </div> </div> $('#tab').tab();
  4. Semantic way directives bootstrap ... tab components <tabset> <tab heading="Title

    1"> <p>Content 1 goes here</p> </tab> <tab heading="Title 2"> <p>Content 2 goes here</p> </tab> <tab heading="Title 3"> <p>Content 3 goes here</p> </tab> </tabset> angular.module('tab') .directive('tabset', function() { // ... }) .directive('tab', function() { // ... });
  5. load angular script bootstrap application set model template <!DOCTYPE html>

    <html lang="en" ng-app> <head> <meta charset="UTF-8"> <title>Hello World</title> </head> <body> <input type="text" ng-model="name"> <h1>Hello {{ name }}</h1> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.15/ angular.min.js"></script> </body> </html>
  6. install the component bower install --save angular-material load the component

    scripts <link rel="stylesheet" href="angular-material.min.css" rel="stylesheet"> <script src="angular-material.min.js"></script> load the component module angular.module('app', ['ngMaterial']);