I am relatively new to AngularJS, but I don’t miss occasion to be surprised by the simplicity of this spectacular framework.
First of all we define a service which contains the functionality we need. In this case is a “Welcome panel”, where it’s visibility can be managed from different points.
Continue reading Same functionality, same UI, but different controller in AngularJS
In AngularJS if we want to share informations across multiple controllers we should use factories.
I needed to change the page titles from multiple locations, so I made use of an extremely simple factory. We are going to use a local variable, named
title which contains the title, and two exposed methods:
title, which is going to be in charge of returning the title, and
setTitle which we’ll call from the controllers to change the title page.
Continue reading Setting Page titles with AngularJS
The page visibility api allows developers and designers to
control when the user is actually on the page, and when the user is away, for example the tab is
opened but not in focus, or the browser is minimized.
The first use I did of this api is to interrupt server side refreshes of the data, while the user is
not on the page, to avoid consumption of server side resources.
The specification gives us two tools: the first one is a variable
document.hidden which is
true if the page is not on focus, and false while the user is actually on the page. The second tool we have is
visibilitychange which tells us when to look for the value of that variable.
So far so good, but how can we use this?
Continue reading Using the page visibility API in an AngularJS project
Following the official karma “Jenkins CI integration tutorial” I couldn’t get them working together properly.
That’s what I did to let them run together:
Added the Node Version Manager to the bash file:
Continue reading Integrating Jenkins and Karma test runner together
What is a Git Hook
Git hooks are basically bash scripts which are going to run before or after a git command is run.
By default git hooks are located under
/usr/share/git-core/templates. If you are using brew for
managing your git, then the location of the default hooks will be under the folder:
In these folders you can see examples of them.
What I use git hooks for
Continue reading How to setup global git hooks
Since I started working on TinyMCE here at ephox, I found the importance of commands I never used in previous project.
The goal here it’s to keep the history of the repository as clean as possible, to keep a meaning when somebody in the future is going to look at that history.
Git has all the tools needed for the job of course. The path we chosen it’s to use the
git rebase command.
git rebase master
git checkout master
git merge forkedBranch
Recently I sow an article about the float label pattern. There is also an article on tutsplus, which explains how to get this using standard jQuery. This is the exact same trick, but using AngularJS:
<label for="name" ng-show="form.name">Name</label>
<input type="text" id="name" placeholder="Name" ng-model="form.name" >
Yes, it needs to be polished and styled a bit, but it is really easy!
Quiver Trees by Night – by Florian Breuer
This picture happened to be on “Bing photo of the day”, last year. I immediately fallen in love with it.
Few days ago, I was speaking with a friend of mine, he also passionate about photography, speaking about this picture.
Took me few hours of research, since, apart from the image in my mind,
This is a sample code to show how to use an angular directive to show png images or svg ones, according to the support of the browser, detected with Modernizr.
Continue reading Angular Directives an SVG image with PNG fallback
In jshit options the devel option allow you to use console.log and alerts without warnings. Personally I switch this setting only when really needed, to prevent annoying alerts or console logging in production.