I'm trying to get simple Hello World from yii2 layout. AppAsset.php:
...
public $js = [
'js/angular.min.js',
];
...
layout/main.php:
...
<html lang="<?= Yii::$app->language ?>" ng-app="app">
...
<body ng-contoller="ctrl">
...
<div class="container">
{{hello}}
...
<?php $this->endBody() ?>
<?=Html::jsFile('@web/js/app.js')?>
</body>
...
/js/app.js
angular.module('app', [])
.controller('ctrl', function($scope){
$scope.hello = 'Hello World!';
console.log('inside ctrl');
});
console.log('outside ctrl');
'outside ctrl' works fine. but block 'inside ctrl' doesn't. Page not shows anything about {{hello}}. Where I missed?