GoConqr has a new look! Let us know what you think.

Module 5 of 7 · Text

class 5 - Dependency Injection

FREDYS FERNANDEZ

Dependency Injection

EJemplo 

var app = angular.module("MyFirstApp",[]);
app.controller("FirstController", function($scope){ 
       $scope.nombre = "Fredy Fernandez ";
       $scope.dateDay= "03/08/2017"
       $scope.nuevoComentario = {};
       $scope.comentarios = [
           {
                   comentario: "Buen Tutorial",
                   username: "Fredy Fernandez",
                   dateDay: "03/08/2017"
                   
           },
           {
                   comentario: "Malisimo Tutorial",
                   username: "Jose Carrasxo",
                   dateDay: "03/08/2017"
           }
       ];
       $scope.agregarComentarios = function(){
               $scope.comentarios.push($scope.nuevoComentario);
               $scope.nuevoComentario = {};
       }
});

 

$scope es una Dependencia

 

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?