Wilson Mendes
GDE Angular
@willmendesneto
...
.config(affiliateLinksProvider => {
...
return affiliateLinksProvider.register({
href: '/casino',
alt: 'SunCasino',
image: '/images/suncasino-logo.svg',
current: isCasino
});
});
...
.provider('affiliateLinks', () => {
const links = [];
...
return {
register: (attributes) => {
return links.push(attributes);
},
$get: () => {
return {
hasAny: links.length > 0,
all: links
};
}
};
});
<div class="affiliate-links">
<div class="nav-items-group">
<a
class="nav-item"
target="_self"
ng-repeat="link in links track by link.href"
ng-class="{ 'active': link.current }"
ng-click="setActive(link)"
ng-href="{{ ::link.href }}">
<img
ng-src="{{ ::link.image }}"
alt="{{ ::link.alt }}">
</a>
</div>
</div>
is...
# Makefile
...
PATH := $(PATH):node_modules/.bin
SHELL := bash -eu -o pipefail -c
CPUS ?= $(shell node -p "require('os').cpus().length" 2> /dev/null || echo 1)
MAKEFLAGS += --warn-undefined-variables --no-builtin-rules --output-sync
MAKEFLAGS += --jobs $(CPUS)
...
Microservices, microframeworks, micro-whatever...
* = Or we can reuse everything that is possible
... And don't forget this, ok? Or ...
Wilson Mendes
@willmendesneto