background preloader

AngularJS

Facebook Twitter

Everything you need to understand to start with... Utiliser AngularJS en respectant les recommandations W3C et SEO. AngularJS est un régale pour toute création d'Application Web de petite et moyenne taille.

Utiliser AngularJS en respectant les recommandations W3C et SEO

J'entends par là, des ensembles d'interfaces web ou l'utilisateur est sollicité à participer au remplissage de contenu par l'intermédiaire de champs, liste, bouton, etc. Le principe est le suivant : sortir le contenu utile du HTML pour le ranger dans un scope JavaScript afin de le manipuler plus aisément et parsemer le HTML de référence à ce scope de contenu. L'avantage est que le contenu a sa propre vie, et n'est plus figé dans le HTML et surtout toute mise à jour de contenu dans le JavaScript entraîne sa mise à jour dans le HTML, bien pratique.

Angular Material - Demos > Autocomplete. How to Create a Simple Modal Dialog Directive in Angular.js · Adam Albrecht. 12 Dec 2013 Modals are Easy I’ve used a dozen or so modal / lightbox plugins over the years, almost exclusively jQuery-based.

How to Create a Simple Modal Dialog Directive in Angular.js · Adam Albrecht

But you know what I didn’t realize until fairly recently? Modals are easy to build yourself from scratch. So let’s make one in the Angular fashion. The Requirements I want to be able to create a modal with the following HTML: <modal-dialog show='modalShown' width='750px' height='90%'><p>Modal Content Goes here<p></modal-dialog> And I’d like it to have the following features: Toggle it by setting a single $scope variable to true or false (above, the variable is modalShown) Optionally specify the height and width as either a px or % value.

The Directive Code This is a fairly simple directive, with a link function that’s only a few lines long. The Template The template is also fairly basic. The CSS I’m not going to spend any time going over this, but I will say that the following will only work in modern browsers (specifically the translate function). Triggering the Modal. JS Bin - Collaborative JavaScript Debugging. AngularJS $timeout and $interval. Last updated: 2014-11-19 AngularJS has two timer services, $timeout and $interval, which you can use to call functions in your application.

AngularJS $timeout and $interval

The $timeout and $interval services are similar in their functionality to JavaScript's setTimeout() and setInterval() functions (actually belonging to the window object). The functionality of these services is also similar, so I will cover both in this text. "Thinking in AngularJS" if I have a jQuery background? AngularJS $timeout and $interval. Creating a Slide Show Plugin With AngularJS. Gone are the days when you used to write hundreds of lines of jQuery to create a custom image slider!

Creating a Slide Show Plugin With AngularJS

It’s time to go Angular and achieve the same goal with smaller, simpler code. This tutorial will show how to create a slide show plugin with AngularJS. We will use Angular directives and animations to achieve this. If you are not familiar with directives, be sure to read my AngularJS directive series. Another nice thing about this approach is that, we are not going to write a single line of jQuery! Step 1: Creating the AngularJS Directive When it comes to AngularJS it’s all about architecting the app first and then using the appropriate markup/design. The important thing to note is that we have isolated the scope of our directive. Step 2: Set Up the Controller to Supply Images Next, let’s create a controller that creates an array of five image objects in its scope. Step 3: Write the Directive Markup Now let’s return to our directive and produce the markup.

The markup is pretty simple. Découvrez AngularJS - Angular-js.fr. Cette article est la traduction d’une réponse trouvée sur le site Stack Overflow et écrite par Josh David Miller.

Découvrez AngularJS - Angular-js.fr

La question était : « Comment penser en AngularJS quand on a l’habitude d’utiliser jQuery ? » Et comme beaucoup de développeurs sont dans ce cas, j’ai pensé que ça serait une excellente approche pour découvrir AngularJS. Si l’article vous plait, n’hésitez pas à envoyer un petit tweet à @joshdmiller 1. Ne concevez pas votre page, pour après la modifier avec des manipulations du DOM Dans jQuery, vous concevez une page, puis vous la rendez dynamique. Mais en AngularJS, vous devez commencez en ayant en tête votre architecture. 2. Ne partez pas avec l’idée que jQuery peut faire X, Y ou Z, et qu’il suffira d’ajouter AngularJS au dessus pour les modèles et les contrôleurs. 3. Tout d’abord ayez en tête que les « single-page applications » sont avant tout des applications.

Comment fait-on cela ? La view est le « record » officiel En jQuery, on change la view « programmatiquement ». 4. Tutoriels et articles AngularJS en français. Application Mobile Pour Les Nuls. Jacopotarantino/angular-match-media. Tutoriel AngularJS.