Skip to content

Commit e5cb32a

Browse files
Property binding and event binding done
1 parent c4343bf commit e5cb32a

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

src/app/app.component.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ <h1>
66
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
77
</div>
88

9+
<div>
10+
<button class="btn btn-success" [disabled]="isButtonDisabled" (click)="changeTestMessage()">Test Button</button>
11+
</div>
12+
13+
<div class="row">
14+
<div class="col-xs-6 col-xs-offset-3">
15+
<p>{{testMessage}}</p>
16+
</div>
17+
</div>
18+
919
<div>
1020
<app-warning-alert></app-warning-alert>
1121
<app-success-alert></app-success-alert>

src/app/app.component.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,24 @@ import { Component } from '@angular/core';
66
styleUrls: ['./app.component.css']
77
})
88
export class AppComponent {
9-
title = 'app';
9+
10+
isButtonDisabled:boolean
11+
testMessage:string
12+
13+
constructor(){
14+
this.isButtonDisabled = true
15+
16+
setTimeout(()=>{
17+
this.isButtonDisabled = false
18+
},2000)
19+
}
20+
21+
22+
changeTestMessage(){
23+
this.testMessage = "This is test message"
24+
}
25+
26+
printName(){
27+
28+
}
1029
}

src/index.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77

88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<link rel="icon" type="image/x-icon" href="favicon.ico">
10+
11+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous" />
12+
1013
</head>
1114
<body>
1215
<app-root></app-root>
16+
17+
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
18+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
19+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
1320
</body>
1421
</html>

0 commit comments

Comments
 (0)