I'm trying to get some code I found to work, not sure if I have it in the right components:
This is in: app.component.ts
This is in: app.component.html
I'm using MS Visual Studio Code and in app I'm getting: "contains emphasized items" error and in app.component.ts I'm getting "Untracked" error.
In the command line I'm getting this error: "error TS2304: Cannot find name 'angular'."
I was using this code to learn angular and so far I'm already stumped. Any help or tips would be appreciated!
This is in: app.component.ts
Code:
angular.module("my-app", [])
.controller("myCtrl", function($scope) {
$scope.someFunction = function() {
$scope.date = new Date();
}
})
This is in: app.component.html
Code:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<body ng-app="my-app" ng-controller="myCtrl">
<pre>current date: {{date | date: '<MM>
<dd></dd>/yyyy'}}</pre>
<pre>time: {{date | date: 'HH:mm:ss'}}</pre>
<button ng-click="someFunction()">show date time</button>
</body>
I'm using MS Visual Studio Code and in app I'm getting: "contains emphasized items" error and in app.component.ts I'm getting "Untracked" error.
In the command line I'm getting this error: "error TS2304: Cannot find name 'angular'."
I was using this code to learn angular and so far I'm already stumped. Any help or tips would be appreciated!