I am currently building a web application with Angular and I am using Angular Material for some UI components. Currently, I have an issue that I can't resolve. When I use the datepicker like described on https://material.angularjs.org/latest/demo/datepicker, the window opens but it stays empty.
Here's the code snippet for the datepicker.
<md-datepicker ng-model="vm.registrationData.birthDate"
md-placeholder="{{'start_register_birth_date' | translate}}"
required></md-datepicker>
<div class="error-message"
ng-messages="registerForm.birthDate.$error"
ng-if="registerForm.birthDate.$touched && registerForm.birthDate.$invalid">
<div class="arrow-right"></div>
<p ng-message="required">{{'start_register_error_birthDate_required' | translate}}</p>
</div>
Is there maybe something wrong with my imports?
<!-- bower:js -->
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-messages/angular-messages.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-translate/angular-translate.js"></script>
<script src="bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.js"></script>
<script src="bower_components/angular-ui-router/release/angular-ui-router.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-aria/angular-aria.js"></script>
<script src="bower_components/angular-material/angular-material.js"></script>
<script src="bower_components/moment/moment.js"></script>
<!-- endbower -->
<script src="js/app.min.js"></script>
<script src="js/config.min.js"></script>
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/angular-material/angular-material.css" />
<!-- endbower -->
<link rel="stylesheet" type="text/css" href="css/styles.css" />
Use an older version of Angular, say 1.5.9. Angular 1.6 disables prebinding of controllers.
See Issue #10168 for more details. You can add
angular.module('myApp', [])
.config(function($compileProvider) {
$compileProvider.preAssignBindingsEnabled(true);
});
if you insist on using Angular 1.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With