Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exposing ng- properties for directive
Message
 
 
À
29/07/2015 10:48:36
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01622610
Message ID:
01622648
Vues:
39
>I simply mean that your directive is named 'smDateTimePicker' and the element is 'data-sm:-time-picker'
>Don't see how you expect those to wire up.....

Here is the beginning of the correct directive
 app.directive('smTimePicker', [function () {
        return {
            require: 'ngModel',
            restrict: 'E',
            scope: {
                ngModel: '=',
                form: '=',
                name: '@',
                placeholder: '@',
                startTime: '=',
                endTime: '=',
                validTimeRange: '&'
            },
            templateUrl: "/app/templates/smTimePicker",
and the template for it
@using Siriusware.Resources;
<div class="input-group">
    <input type="text" autocomplete="off" id="{{name}}" name="{{name}}" class="form-control" placeholder="{{placeholder}}" />
    <span class="input-group-addon datepickerbutton">
        <i class="fa fa-clock-o"></i>
    </span>
</div>
<div class="field-validation-error">
    <span ng-show="!validTimeRange()">@Messages.invalidStartTime</span>    
</div>
So, they are similar.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform