On Github brenelz / Intro-To-Angular-Talk
Created by Brenley Dueck / @brenelz for Winnipeg.js
<!DOCTYPE html> <html ng-app="todoApp"> <head> <title>Angular App | Winnipeg.JS</title> </head> <body> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"> </script> <script src="js/app.js"></script> </body> </html>
var todoApp = angular.module('todoApp',[]);
... <h3>Welcome to {{location || "Winnipeg.js"}}!</h3> <p><input ng-model="location" placeholder="Enter Location"></p> ...
<!DOCTYPE html> <html ng-app="todoApp"> <head> <title>Angular App | Winnipeg.JS</title> </head> <body ng-controller="TodoCtrl"> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"> </script> <script src="js/app.js"></script> </body> </html>
var todoApp = angular.module('todoApp',[]); todoApp.controller('TodoCtrl',function($scope){ });
var todoApp = angular.module('todoApp',[]); todoApp.controller('TodoCtrl',function($scope){ $scope.name = 'Brenley'; $scope.todos = [ 'Go to work', 'Grab something to eat', 'Present at Winnipeg.js' ]; });
... <h2>Todos List for <span>{{name}}</span></h2> <ul> <li ng-repeat="todo in todos"> {{todo}} </li> </ul> ...
... <p><input type="text" ng-model="search" placeholder="Search"></p> <ul> <li ng-repeat="todo in todos | filter:search"> {{todo}} </li> </ul> ...
<date-picker></date-picker>
<div date-picker></div>
<html ng-app="todoApp">
<body ng-controller="TodoCtrl">
<p><input type="text" ng-model="search" placeholder="Search"></p>
<ul> <li ng-repeat="todo in todos"> </ul>
<button ng-click="addTodo()">Add Todo</button>
<span ng-hide="!items.length" class="num">{{items.length}}</span>
todoApp.controller('TodoCtrl',function($scope,$http){ $http({ url: 'http://jsonstub.com/users', method: 'GET' }).success(function (data) { $scope.users = data.users; }); });
<!DOCTYPE html> <html ng-app="todoApp"> <head> <title>Angular App | Winnipeg.JS</title> </head> <body ng-controller="TodoCtrl"> <h2>Todos List for <span>{{name}}</span></h2> <p>{{todos.length}} items visible</p> <ul> <li ng-repeat="todo in todos"> {{todo}} | <a ng-click="deleteTodo($index)">Delete</a> </li> </ul> <p><input type="text" ng-model="todoNew" /> <button ng-click="addTodo()">Add Todo</button></p> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"> </script> <script src="js/app.js"></script> </body> </html>
var todoApp = angular.module('todoApp',[]); todoApp.controller('TodoCtrl',function($scope){ $scope.name = 'Brenley'; $scope.todos = [ 'Go to work', 'Grab something to eat', 'Present at Winnipeg.js' ]; $scope.addTodo = function() { var todo = $scope.todoNew; $scope.todos.push(todo); $scope.todoNew = ''; }; $scope.deleteTodo = function(index) { $scope.todos.splice(index,1); }; });
3 items visible
Add Todo