Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Directives
Message
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Divers
Thread ID:
01605023
Message ID:
01605027
Vues:
58
This message has been marked as the solution to the initial question of the thread.
>Hi everybody,
>
>I am still not clear how directives work and how to make them optional.

The link function passes a third parameter which lets you get at the attributes:
// Instead of this:
            link: function (scope, element) {
// Do this:
            link: function (scope, element, attrib) {
Now you have access to the attributes, so to grab the value:
var attribValue = attrib.smFocus
(take a look at attrib in the debugger and you'll see the values it holds).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform