Angularjs + Yeoman
380 views | +0 today
Follow
Your new post is loading...
Your new post is loading...
Scooped by Carla França
Scoop.it!

Show route only after all promises are resolved

Show route only after all promises are resolved | Angularjs + Yeoman | Scoop.it
Check the code on Github The code is available on GITHUB.Check the repository route-loading-delay-demo. This post is about a trick I learned this summer while reading the book AngularJS, by Brad Gr...
more...
No comment yet.
Rescooped by Carla França from JavaScript for Line of Business Applications
Scoop.it!

Using Resolve In AngularJS Routes

Using Resolve In AngularJS Routes | Angularjs + Yeoman | Scoop.it

In a previous post about testing I mentioned that route resolves can make authoring unit tests for a controller easier. Resolves can also help the user experience.

A resolve is a property you can attach to a route in both ngRoute and the more robust UI router. A resolve contains one or more promises that must resolve successfully before the route will change. This means you can wait for data to become available before showing a view, and simplify the initialization of the model inside a controller because the initial data is given to the controller instead of the controller needing to go out and fetch the data.

As an example, let’s use the following simple service which uses $q to simulate the async work required to fetch some data.


Via Jan Hesse
more...
No comment yet.
Rescooped by Carla França from JavaScript for Line of Business Applications
Scoop.it!

Working with Modules in Angular.js

Working with Modules in Angular.js | Angularjs + Yeoman | Scoop.it

We can think of a module as a container for the different parts of our app – controllers, services, filters, directives, etc. Angular JS supports modules, using which we can divide the JavaScript code involved in our application. Creating modules not only helps separating the code into individual concerns but also improves unit-testability. The modules can be easily replaced by some mocks while unit testing Angular controllers.Every module should have a name, which is specified in the first parameter. Second parameter to module function is an array, which may contain names of other modules or services. If the module doesn’t depend on anything, the array can be left blank. 


Via Jan Hesse
more...
No comment yet.
Scooped by Carla França
Scoop.it!

Introduction to the MEAN Stack - Tuts+ Code Tutorial

Introduction to the MEAN Stack - Tuts+ Code Tutorial | Angularjs + Yeoman | Scoop.it
Introducing MEAN, a fullstack platform for quickly building JavaScript web apps.
more...
No comment yet.
Scooped by Carla França
Scoop.it!

ng-newsletter

Everything you need to know about Angular SEO. We're covering from server-side DIY SEO servers to using professional services. Interested in getting your Angular app SEO'd? Check it out.
more...
No comment yet.
Rescooped by Carla França from Javascript
Scoop.it!

Create a reusable AngularJS input form component

Create a reusable AngularJS input form component | Angularjs + Yeoman | Scoop.it

One of the beauty of the AngularJS framework is its ability to isolate complexity with services and directives; This is perfect for segmenting our code, create very testable components, and make them reusable. A directive, which is an anticipation of the future web components, is a piece of isolated javascript, HTML and CSS that encapsulate a specific behaviour and that you can easily reuse in various apps. Once created, a directive is simply invoked by adding it to the DOM via a HTML tag (<accordion></accordion>, or a custom attribute <div accordion></div>, or a CSS class <div class="accordion"></div> (and even as HTML comment).


Via Jan Hesse, Darlene Tate
more...
No comment yet.
Rescooped by Carla França from JavaScript for Line of Business Applications
Scoop.it!

AngularJS Service / Factory Tutorial. AngularJS service examples

AngularJS Service / Factory Tutorial. AngularJS service examples | Angularjs + Yeoman | Scoop.it

Putting business and other logic within services has many advantages. First it fulfills the principle of separation of concern or segregation of duties. Each component is responsible for its own work making application more manageable. Second this way each component can be more testable. AngularJS provides first class support for unit testing. Thus we can quickly write tests for our services making them robust and less error prone.

 

Consider above diagram. Here we divide our application in two controllers: 1. Profile and 2. Dashboard. Each of these controllers require certain user data from server. Thus instead of repeating the logic to fetch data from server in each controller, we create a User service which hides the complexity. AngularJS automatically inject User service in both Profile and Dashboard controller. Thus our application becomes for modular and testable.


Via Jan Hesse
more...
No comment yet.
Rescooped by Carla França from Modern web development
Scoop.it!

ng-newsletter

ng-newsletter | Angularjs + Yeoman | Scoop.it
Learning AngularJS can be complex. There are a lot of resources available on the web, conflicting and confusing blog posts. This week's post is to serve as your official guide.

Via Tony Brown
more...
No comment yet.
Rescooped by Carla França from JavaScript for Line of Business Applications
Scoop.it!

AngularJS Form Validation

AngularJS Form Validation | Angularjs + Yeoman | Scoop.it

Today we’ll be looking at at the ways that Angular helps us do form validations. We’ll be talking more on forms using Angular.

We’ll focus on client side validation and using the built in Angular form properties.

Angular provides properties on forms that help us validate them. They give us various information about a form or its inputs and are applied to a form and inputs.


Via Jan Hesse
more...
No comment yet.
Scooped by Carla França
Scoop.it!

AngularJS Routing Using UI-Router

AngularJS Routing Using UI-Router | Angularjs + Yeoman | Scoop.it
AngularJS provides a great way to make single page applications. When creating single page applications, routing will be very important. We want our navigation to feel like a normal site and still not have our site refresh.
more...
No comment yet.
Scooped by Carla França
Scoop.it!

AngularJS Directives Tutorial - Part 1 - Demystifying Angular Directives

AngularJS Directives don't have to be complicated! This quick tutorial will help you learn how to make an Angular directive in no time. Angular.js is a power...
more...
No comment yet.
Scooped by Carla França
Scoop.it!

Yeoman Bower and Grunt - Building Modern Webapps With Ease - YouTube

On 22/5/13, Shai Reznik, gave a lecture about Yeoman, Bower and Grunt, as part of Google Developers Group (GDG) Meetup. In the lecture Shai went over a short...
Carla França's insight:

if you want to have a proper dev workflow this is an excelente  starting point. 

 

more...
No comment yet.
Scooped by Carla França
Scoop.it!

Automating Your Front-End Workflow With Yeoman 1.0 - YouTube

Writing a modern web app these days can sometimes feel like a tedious process; frameworks, boilerplates, abstractions, dependency management, build processes...
more...
No comment yet.
Scooped by Carla França
Scoop.it!

AngularJS promise, or dealing with asynchronous requests in AngularJS

AngularJS promise, or dealing with asynchronous requests in AngularJS | Angularjs + Yeoman | Scoop.it
AngularJS Promise is one of my favourite features of AngularJS. Promises help a lot by handling asynchronous return of data, and allow to assign properties synchronously even when the return is asy...
more...
No comment yet.
Rescooped by Carla França from Javascript
Scoop.it!

The 80/20 Guide to Writing AngularJS Directives

The 80/20 Guide to Writing AngularJS Directives | Angularjs + Yeoman | Scoop.it

For most of you, the reason that you’re writing directives is probably pretty straightforward, such as to integrate with existing Bootstrap modules and jQuery extensions, or to DRY up your UI. In this post, I’ll lay out the basic idea behind AngularJS directives, demonstrate what they do with roughly corresponding jQuery code, and provide you with enough knowledge to develop some pretty sophisticated directives.
At the highest level, a directive allows you to wire your custom UI components in to AngularJS’s two-way data-binding and scoping features, allowing you to define easily reusable ways for your users to view and interact with your underlying data. By default, a directive is a function that is run on every element with a particular attribute. This function takes as parameters the associated element and the AngularJS scope that this element is in. Let’s start out with an extremely simple example: setting the minimum height and width of an image while preserving its aspect ratio. There are several ways to do this, but the easiest is to make set the image as the background of a div using the following CSS...


Via Jan Hesse, Darlene Tate
more...
No comment yet.
Rescooped by Carla França from JavaScript for Line of Business Applications
Scoop.it!

Cookies vs Tokens. Getting auth right with Angular.JS

Cookies vs Tokens. Getting auth right with Angular.JS | Angularjs + Yeoman | Scoop.it

There are basically two different ways of implementing server side authentication for apps with a frontend and an API:

* The most adopted one, is Cookie-Based Authentication (you can find an example here) that uses server side cookies to authenticate the user on every request.

* A newer approach, Token-Based Authentication, relies on a signed token that is sent to the server on each request.


Via Jan Hesse
more...
No comment yet.
Rescooped by Carla França from JavaScript for Line of Business Applications
Scoop.it!

Recipes with Angular.js

Recipes with Angular.js | Angularjs + Yeoman | Scoop.it

A community project dedicated to collecting resources for the Angular.js framework. You find here easy to follow cookbook style recipes for issues you are likely to face when working with Angular.js.


Via Jan Hesse
more...
No comment yet.