A short time ago I have studied AngularJS through materials like this;
Online Course on YOUTUBE about AngurlaJS > > > > CLICK HERE.
So what he teaches shows that we should link the angular.js file according to video lessons;
As I started to follow the lessons and started to work, then I found this demonstration of the Angular;
And with that I tried to implement, but I did not succeed as you can see in this link that I posted in StackOverFlow myself;
The Datepicker of Angular Material does not work
I have a colleague of mine who helped me solve it and put this page together as you can see in the code below, and it works perfectly;
<html>
<head>
<title>Lista Telefonica</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Angular Material style sheet -->
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.css">
<style>
.datepickerdemoBasicUsage {
/** Demo styles for mdCalendar. */
}
.datepickerdemoBasicUsage md-content {
padding-bottom: 200px;
}
.datepickerdemoBasicUsage .validation-messages {
font-size: 12px;
color: #dd2c00;
margin: 10px 0 0 25px;
}
</style>
</head>
<body ng-app="myApp">
<div ng-controller="AppCtrl" style='padding: 40px;' ng-cloak>
<md-content>
<h4>Standard date-picker</h4>
<md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker>
<h4>Disabled date-picker</h4>
<md-datepicker ng-model="myDate" md-placeholder="Enter date" disabled></md-datepicker>
<h4>Date-picker with min date and max date</h4>
<md-datepicker ng-model="myDate" md-placeholder="Enter date" md-min-date="minDate" md-max-date="maxDate"></md-datepicker>
<h4>Only weekends are selectable</h4>
<md-datepicker ng-model="myDate" md-placeholder="Enter date" md-date-filter="onlyWeekendsPredicate"></md-datepicker>
<h4>Only weekends within given range are selectable</h4>
<md-datepicker ng-model="myDate" md-placeholder="Enter date" md-min-date="minDate" md-max-date="maxDate" md-date-filter="onlyWeekendsPredicate"></md-datepicker>
<h4>With ngMessages</h4>
<form name="myForm">
<md-datepicker name="dateField" ng-model="myDate" md-placeholder="Enter date" required md-min-date="minDate" md-max-date="maxDate"
md-date-filter="onlyWeekendsPredicate"></md-datepicker>
<div class="validation-messages" ng-messages="myForm.dateField.$error">
<div ng-message="valid">The entered value is not a date!</div>
<div ng-message="required">This date is required!</div>
<div ng-message="mindate">Date is too early!</div>
<div ng-message="maxdate">Date is too late!</div>
<div ng-message="filtered">Only weekends are allowed!</div>
</div>
</form>
</md-content>
</div>
<!-- Angular Material requires Angular.js Libraries -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.min.js"></script><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-aria.min.js"></script><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-messages.min.js"></script><!--AngularMaterialLibrary--><scriptsrc="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.js"></script><script>angular.module('myApp',['ngMaterial']).controller('AppCtrl',function($scope){$scope.myDate=newDate();$scope.minDate=newDate($scope.myDate.getFullYear(),$scope.myDate.getMonth()-2,$scope.myDate.getDate());$scope.maxDate=newDate($scope.myDate.getFullYear(),$scope.myDate.getMonth()+2,$scope.myDate.getDate());$scope.onlyWeekendsPredicate=function(date){varday=date.getDay();returnday===0||day===6;}});</script></body></html>
ButIcouldseethathenotonlyincludedangularJSlinksbutalsoinsertedotherlinksthatIdidnotthinkhehad.Yousee,I'maBack-Endprogrammer,andbytheincredibleIunderstandverylittleaboutFrameWorksworkingwithFrond-ENd,andI'mstartingtolearnBootstrapnow,sobepatientwithme!
ThecommentImadeIrefertothesepartsofthecode;
<!--AngularMaterialrequiresAngular.jsLibraries--><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.min.js"></script><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-aria.min.js"></script><scriptsrc="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-messages.min.js"></script><!--AngularMaterialLibrary--><scriptsrc="http://ajax.googleapis.com/ajax/libs/angular_material/1.1.0-rc2/angular-material.min.js"></script>
I understand that AppCtrl is the controller, I understood that myApp is the module, but I did not understand what it is and what the > ngMaterial