background preloader

Angular

Facebook Twitter

OrderBy. Orders a specified array by the expression predicate.

orderBy

It is ordered alphabetically for strings and numerically for numbers. Note: if you notice numbers are not being sorted correctly, make sure they are actually being saved as numbers and not strings. Usage In HTML Template Binding In JavaScript $filter('orderBy')(array, expression, reverse) Arguments Returns Example Edit in Plunker It's also possible to call the orderBy filter manually, by injecting $filter, retrieving the filter routine with $filter('orderBy'), and calling the returned filter routine with the desired parameters. Developer Guide: Templates. Loading...

Developer Guide: Templates

In Angular, templates are written with HTML that contains Angular-specific elements and attributes. Angular combines the template with information from the model and controller to render the dynamic view that a user sees in the browser. These are the types of Angular elements and attributes you can use: Directive — An attribute or element that augments an existing DOM element or represents a reusable DOM component.Markup — The double curly brace notation {{ }} to bind expressions to elements is built-in Angular markup.Filter — Formats data for display.Form controls — Validates user input.

The following code snippet shows a template with directives and curly-brace expression bindings: Angularjs - What is the difference between ui-bootstrap-tpls.min.js and ui-bootstrap.min.js. Using $compile in Angular. Creating a custom directive in AngularJS is easy, let’s start with the HTML for a simple example.

Using $compile in Angular

The above markup is using a directive named otcDynamic, which only provides a template. When combined with a controller, the presentation will allow the user to click a button to see a message appear on the screen. Make It Dynamic Next, imagine the otcDynamic directive can’t use a static template. The directive needs to look at some boolean flags, user data, or service information, and dynamically construct the template markup. The above sample no longer functions correctly and will only render a button displaying the literal text {{label}} to a user. Markup has to go through a compilation phase for Angular to find and activate directives like ng-click and {{label}}.

Compilation The $compile service is the service to use for compilation. $log. UI Grid: Index. Angular-ui/ng-grid. Introducing the AngularJS Batarang. Today, after eight months of work, over two thousand commits, nineteen beta and six release candidates, we finally released AngularJS 1.3.0 superluminal-nudge!

Introducing the AngularJS Batarang

This release includes many notable new features: AngularJS Cheat Sheet by ProLoser. AngularJS. Introducing Synth - A new Node.js web framework designed just for AngularJSSpeaker: Jon Abrams (bio below) This was the first public demonstration of the new back-end web framework called Synth 1 created by Jon Abrams.

AngularJS

It's a different take on traditional Node.js web frameworks It's designed to make it easier to create back-end resources that can then be automatically preloaded when loading Angular.js views. Jon presented the following: - Why Synth was created.- A quick overview of the major features and how to use them.- The creation of a sample app. A quick look at the major features: - Easily create new RESTful API resources by just creating folders andnaming request handling functions a certain way.. - Preloading AngularJS model data on page load (saving an extra roundtrip). - Preloading html view on page load (saving another extra roundtrip!)

AngularUI. Building Better Models For AngularJS. Retrieving JSON data and binding the data to a template is easy with Angular, so easy that quite a bit of Angular code appears like the following.

Building Better Models For AngularJS

What’s of interest is the ng-click directive, which is using an expression to invoke behavior directly against $scope. The approach works well for simple applications and demos, but in the face of more complexity it would nice to have a proper model object that knows nothing about scopes or templates and contains straight-up logic related to a business concept, in which case ng-click might look like the following. Subtle difference, but in my experience it is small changes like this that can make a code base easier and enjoyable to work with because responsibilities are well thought and separated.

Starting Over. How to Create a Dynamic Modal Directive in Minutes using Angular and UI Bootstrap. This talk I will walk through creating a modal window that is generic in the sense that it will take any old arbitrary html and stuff it in a modal window that is used throughout your site.

How to Create a Dynamic Modal Directive in Minutes using Angular and UI Bootstrap

This uses the Angular Bootstrap UI Modal window and wraps that directive in another directive. You can find the source code to a demo that I have created for this here. I have broken this down into the major sections in which, hopefully, this will be explained. You can either follow along or just look at the code located on the github link above. So let's get started. GitHub Demo Repo.

CHANGELOG.md at master · angular/angular.js. Creating a Store Module - Shaping up with Angular.js. Documentation for step_05. Enough of building an app with three phones in a hard-coded dataset!

Documentation for step_05

Let's fetch a larger dataset from our server using one of Angular's built-in services called $http. We will use Angular's dependency injection (DI) to provide the service to the PhoneListCtrl controller. There is now a list of 20 phones, loaded from the server. Ramp Up - Shaping up with Angular.js. Angular directives for Bootstrap. The $uibPosition service provides a set of DOM utilities used internally to absolute-position an element in relation to another element (tooltips, popovers, typeaheads etc...). getRawNode(element)

Angular directives for Bootstrap

Ui-grid.info. AngularJS.