Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

input type shows object angularjs

app.directive('labelField', function () {
    return {
        restrict: 'AE',
        link: function ($scope, element, attrs) {
            $scope.$watch(attrs['ngModel'], function (newValue) {
                if (newValue) {
                    element[0].value = newValue[attrs['labelField']];
                }
            })
        }
    }
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #input #type #shows #object #angularjs
ADD COMMENT
Topic
Name
4+8 =