Angular.js Services


Angular.js Services

현재 url 가져오기 <div ng-app="App" ng-controller="Ctrl"> <p>The url of this page is:</p> <h3>{{myUrl}}</h3> </div> var app = angular.module('App', []); app.controller('Ctrl', function($scope, $location) { $scope.myUrl = $location.absUrl(); }); 시간 이벤트 <div ng-app="App" ng-controller="Ctrl"> <h1>{{content}}</h1> </div> <script> var app = angular.module('App', []); app.controller('Ctrl', function($scope, $timeout) { $scope.content= "시간이지나면"; $timeout(function () { $scope.content= "모습이변한다"; }, 2000); });...



원문링크 : Angular.js Services