From 498f24c5c58e70fb17dfd65edb549b440707d086 Mon Sep 17 00:00:00 2001 From: Nicholas Eduardo Date: Mon, 11 May 2015 14:31:20 -0300 Subject: [PATCH 1/2] add service and directive in file angularjs.md --- angularjs.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/angularjs.md b/angularjs.md index 941dfe95d..63e56325d 100644 --- a/angularjs.md +++ b/angularjs.md @@ -42,6 +42,33 @@ layout: default ($scope, $http) -> ] +### Service + + App.factory('NameService', function($http){ + return { + get: function(){ + return $http.get(url); + } + } + }); + +In controller you call with parameter and will use promises to return data from server. + + App.controller('controllerName', + function(NameService){ + NameService.get() + .then(function(){}) + }) + +### Directive + + App.directive('name', function(){ + return { + template: '

Hello

' + } + }); + +In HTML will use to render your template

Hello

### HTTP From af8fecb5a1ce3f9a8e83991bb33e307aaf1c9da4 Mon Sep 17 00:00:00 2001 From: Nicholas Eduardo Date: Mon, 11 May 2015 14:34:08 -0300 Subject: [PATCH 2/2] add example --- angularjs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angularjs.md b/angularjs.md index 63e56325d..d06e1fe03 100644 --- a/angularjs.md +++ b/angularjs.md @@ -68,7 +68,7 @@ In controller you call with parameter and will use promises to return data from } }); -In HTML will use to render your template

Hello

+In HTML will use `` to render your template `

Hello

` ### HTTP