<div ng-app="" ng-init="firstName='Yunen';lastName='Ramos'"> <p>Hello {{firstName}} {{lastName}}!</p> </div>Otra manera de hacerlo es la siguiente:
<div ng-app="" ng-init="firstName='Yunen';lastName='Ramos'"> <p>Hello <span ng-bind="firstName + ' ' + lastName"></span>!</p> </div>No es muy común usar ng-init. Aquí puede encontrar información general sobre las Expresiones en AngularJS.
0 comentarios:
Publicar un comentario