Skip to content

Instantly share code, notes, and snippets.

View MohammadHabbab's full-sized avatar
:octocat:
Don't read this ... wait, you just did!

Mohammad Habbab MohammadHabbab

:octocat:
Don't read this ... wait, you just did!
View GitHub Profile

Keybase proof

I hereby claim:

  • I am MohammadHabbab on github.
  • I am mohammadhabbab (https://keybase.io/mohammadhabbab) on keybase.
  • I have a public key whose fingerprint is 301D C0D4 5EA7 5901 4734 3C1C 478A EACC 39ED 8C3B

To claim this, I am signing this object:

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

@MohammadHabbab
MohammadHabbab / code.js
Last active August 29, 2015 14:03
Simple Angular Filter
angular.module('app', [])
.controller('ctrl', function ($scope) {
//assume we recieve this from server, we will use this as a parameter we send to the filter
$scope.serverCurrency = '$';
//we will use these values to be modified by filter before viewing
$scope.values = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
})
//our beloved filter, filter definitions behave as factories, so we can inject dependencies, or define private members for view-logic inside the filter() definition block.
/**
* @constructor
*/
function Injector() {
/**
* @type {!Object.<string, function(Injector=): !Object>}
*/
this.factories = {};