From c2f2587a79aeb77aad66f081cf924a79348a698e Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 19 Jan 2011 15:42:11 -0800 Subject: fixed example rendering, add tests for it. --- docs/angular.service.ngdoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/angular.service.ngdoc') diff --git a/docs/angular.service.ngdoc b/docs/angular.service.ngdoc index a34142bb..4e4810f9 100644 --- a/docs/angular.service.ngdoc +++ b/docs/angular.service.ngdoc @@ -76,7 +76,7 @@ window alert. }; }, {$inject: ['$window']}); - + And here is a unit test for this service. We use Jasmine spy (mock) instead of real browser's alert.
var mock, notify;
@@ -85,7 +85,7 @@ beforeEach(function() {
mock = {alert: jasmine.createSpy()};
notify = angular.service('notify')(mock);
});
-
+
it('should not alert first two notifications', function() {
notify('one');
notify('two');
@@ -134,7 +134,7 @@ function myController($loc, $log) {
};
}
// which services to inject ?
-myController.$inject = ['$location', '$log'];
+myController.$inject = ['$location', '$log'];
@example
@@ -149,13 +149,13 @@ myController.$inject = ['$location', '$log'];
}
};
}, {$inject: ['$window']});
-
+
function myController(notifyService) {
this.callNotify = function(msg) {
notifyService(msg);
};
}
-
+
myController.$inject = ['notify'];
--
cgit v1.2.3