보이는 것만
0:02
S… Speaker 2 (108. Why would you Need Services)
Here's an example app which you can find attached to this lecture.
0:05
S… Speaker 2 (108. Why would you Need Services)
Here we can create some accounts.
0:07
S… Speaker 2 (108. Why would you Need Services)
You see we start with three accounts here at the bottom.
0:10
S… Speaker 2 (108. Why would you Need Services)
We can switch the status of these accounts and you can see that whenever I
0:14
S… Speaker 2 (108. Why would you Need Services)
switch it I log something to the console.
0:16
S… Speaker 2 (108. Why would you Need Services)
You can also see that this gets locked if I create
0:20
S… Speaker 2 (108. Why would you Need Services)
a new account here.
0:21
S… Speaker 2 (108. Why would you Need Services)
And overall what we got here is the logging and
0:25
S… Speaker 1 (108. Why would you Need Services)
the data storage.
0:26
S… Speaker 2 (108. Why would you Need Services)
So in general tasks which might be centralized.
0:29
S… Speaker 2 (108. Why would you Need Services)
We also communicate between these components.
0:32
S… Speaker 2 (108. Why would you Need Services)
That's another area where services can be really helpful.
0:36
S… Speaker 2 (108. Why would you Need Services)
Because let's have a look at our code.
0:38
S… Speaker 2 (108. Why would you Need Services)
I got three components.
0:40
S… Speaker 2 (108. Why would you Need Services)
The app component,
0:41
S… Speaker 2 (108. Why would you Need Services)
then the account and the new account component.
0:44
S… Speaker 2 (108. Why would you Need Services)
The app component is where all comes together.
0:47
S… Speaker 2 (108. Why would you Need Services)
There in the template I embed the app new account and the app account component
0:52
S… Speaker 2 (108. Why would you Need Services)
and I use property and event binding to pass data around.
0:56
S… Speaker 1 (108. Why would you Need Services)
For example,
0:57
S… Speaker 2 (108. Why would you Need Services)
I loop through all accounts,
0:58
S… Speaker 2 (108. Why would you Need Services)
which are right now stored in the app component here,
1:01
S… Speaker 2 (108. Why would you Need Services)
and I pass them via property binding to the app account
1:05
S… Speaker 2 (108. Why would you Need Services)
component here.
1:06
S… Speaker 2 (108. Why would you Need Services)
And there,
1:08
S… Speaker 2 (108. Why would you Need Services)
on the other hand,
1:09
S… Speaker 2 (108. Why would you Need Services)
I have an event,
1:10
S… Speaker 2 (108. Why would you Need Services)
which gets fired when I click one of the three change the status buttons,
1:14
S… Speaker 2 (108. Why would you Need Services)
which is submitted here,
1:15
S… Speaker 2 (108. Why would you Need Services)
which will be catched by my app component,
1:19
S… Speaker 2 (108. Why would you Need Services)
where I then handle it again.
1:20
S… Speaker 2 (108. Why would you Need Services)
So I do have event binding to be informed in my app component whenever
1:24
S… Speaker 2 (108. Why would you Need Services)
something changes in the account component.
1:27
S… Speaker 2 (108. Why would you Need Services)
Pretty much the same happens in the new account component.
1:30
S… Speaker 2 (108. Why would you Need Services)
There I can also listen to a click when I create a new account and on
1:34
S… Speaker 2 (108. Why would you Need Services)
such a click, I emit some data to the app component.
1:38
S… Speaker 2 (108. Why would you Need Services)
So this is all fine,
1:40
S… Speaker 2 (108. Why would you Need Services)
but we already got quite a complex setup here to pass data around.
1:44
S… Speaker 2 (108. Why would you Need Services)
And that even though that it's still relatively simple,
1:47
S… Speaker 2 (108. Why would you Need Services)
it's not a complex app here after all.
1:50
S… Speaker 2 (108. Why would you Need Services)
Now in this lecture,
1:51
S… Speaker 2 (108. Why would you Need Services)
we're going to see how services can help us with that and what we
1:56
S… Speaker 2 (108. Why would you Need Services)
have to watch out for.
1:57
S… Speaker 2 (108. Why would you Need Services)
So let's dive into it and build our first service in the
2:01
S… Speaker 1 (108. Why would you Need Services)
next lecture.

이 기록은 AI (자동 음성 인식)에 의해 생성되었습니다. 오류가 있을 수 있습니다 - 중요한 사용을 위해 원본 오디오와 확인하십시오. AI 정책

❤️ STT.ai가 마음에 드시나요? 친구들에게 알려주세요!
요약
요약 을 클릭하여 이 녹음의 AI 요약을 생성합니다.
요약...
이 녹음에 대해 AI에게 물어보기
이 녹음에 대해 질문하십시오 — AI는 관련 섹션을 찾아 답변합니다.