“Kontroler w projektach AngularJS” Kod odpowiedzi

Kontroler w projektach AngularJS

var myApp = angular.module('scopeInheritance', []);
myApp.controller('MainController', ['$scope', function($scope) {
  $scope.timeOfDay = 'morning';
  $scope.name = 'Nikki';
}]);
myApp.controller('ChildController', ['$scope', function($scope) {
  $scope.name = 'Mattie';
}]);
myApp.controller('GrandChildController', ['$scope', function($scope) {
  $scope.timeOfDay = 'evening';
  $scope.name = 'Gingerbread Baby';
}]);
Crazy Cottonmouth

Kontroler w projektach AngularJS


myApp.controller('ChildController', ['$scope', function($scope) {
  $scope.name = 'Mattie';
}]);
myApp.controller('GrandChildController', ['$scope', function($scope) {
  $scope.timeOfDay = 'evening';
  $scope.name = 'Gingerbread Baby';
}]);
Crazy Cottonmouth

Odpowiedzi podobne do “Kontroler w projektach AngularJS”

Pytania podobne do “Kontroler w projektach AngularJS”

Więcej pokrewnych odpowiedzi na “Kontroler w projektach AngularJS” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu