Skip to content

Instantly share code, notes, and snippets.

@rependa
Last active October 21, 2015 18:51
Show Gist options
  • Select an option

  • Save rependa/4a963e75aa3b726d42f5 to your computer and use it in GitHub Desktop.

Select an option

Save rependa/4a963e75aa3b726d42f5 to your computer and use it in GitHub Desktop.
qOpGeO
<div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</div>

AngularJS Applications

AngularJS modules define AngularJS applications.

AngularJS controllers control AngularJS applications.

The ng-app directive defines the application, the ng-controller directive defines the controller.

AngularJS modules define applications: var app = angular.module('myApp', []);

AngularJS controllers control applications:

app.controller('myCtrl', function($scope) {
    $scope.firstName= "John";
    $scope.lastName= "Doe";
});

A Pen by Matt Rependa on CodePen.

License.

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName= "John";
$scope.lastName= "Doe";
});
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.14/angular.min.js"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment