Wednesday, October 18, 2017

bootstrap class=filestyle in ng-repeat angularjs 1.x

I have a form where in i have below code, where i need a file upload control for every object in ng-repeat along with drop down and label. Its rendering fine. For my file upload control, i am using bootstrap “filestyle” class to make it beautiful but the problem is that Filestyle class is not getting applied in ng-repeat. I know that we have limitation that ng-repeat does not apply css class on its elements easily. Can anyone help me with this as i need to apply class=filestyle on each file upload control.

<table class="table table-striped">
                    <thead>
                        <tr>
                            <th style="width: 50%;">Files</th>
                            <th style="width: 20%;">File Type</th>       
                        </tr>
                    </thead>
                    <tbody>
                        <tr ng-repeat="file in allFiles">
                            <td>
                                <input type="file" id="rr" class="filestyle" 
                                    ng-model="fileInfo" data-show-review="false" onchange="angular.element(this).scope().somefunction(this)">
                                <p></p>
                            </td>                            
                        </tr>
                    </tbody>
                </table>

Funny thing is, when open the form in chrome, file upload control appears as normal html file upload control, but when i duplicate the tab, the class=filestyle is applied the file upload control changes to bootstrap one.
I am using angulasjs 1.x

Thanks in advance.

Source: AngularJS



from Angular Questions https://angularquestions.com/2017/10/18/bootstrap-classfilestyle-in-ng-repeat-angularjs-1-x/
via @lzomedia #developer #freelance #web #lzomedia.com

No comments:

Post a Comment