dimanche 27 janvier 2019

How do I get the init array variables to show up on the table?

When running this code the table shows , , for a variable in my init array. I'm fairly new to angular JS and I'm not sure what I did wrong. Must I make a function?

I've tried to place the init directive outside of the variable and it didn't work.

<table ng-init="directives=[
{name:'ng-app',description:'Declare an Angularjs application scope ', reference:'https://www.w3schools.com/angular/tryit.asp?filename=try_ng_intro> '},

{name:'ng-init',description:'Declare variable and initialize them', reference:'https://www.w3schools.com/angular/tryit.asp?filename=try_ng_intro_directives 
'},

{name:'ng-model',description:'Directive binds the value of HTML controls (input, select, textarea) to application data', reference:'https://www.w3schools.com/angular/angular_model.asp'}
]"   
>       
    <tr>
        <th> Directive</th>
        <th> Summary</th>
        <th> Reference</th>
     </tr>
    <tr ng-repeat = "x in directives | orderBy: 'name'">

        <td></td>
        <td></td>
        <td></td>        
    </tr>
</table>     
</div>

The table should display as a head row Directive, Description and Reference. The body of the table should have a directives name, description and reference in respect to the header.




Aucun commentaire:

Enregistrer un commentaire