<commit_before>---
layout: post
title: "Angular usage"
categories: journal
tags: [angular]
---

1. TOC
{:toc}

[W3C Angular reference](https://www.w3schools.com/angular/angular_ref_directives.asp)

Good article explaining [$scope.broadcast and $rootScope.broadcast](https://toddmotto.com/all-about-angulars-emit-broadcast-on-publish-subscribing/)

[Document of $translate](https://angular-translate.github.io/docs/#/api/pascalprecht.translate.$translate)
<commit_msg>update angular usage<commit_after>---
layout: post
title: "Angular usage"
categories: journal
tags: [angular]
---

1. TOC
{:toc}

# Solve garbled character problem

actually it is an HTML problem.
Just put the
`<meta charset="utf-8" >`
tag into your head tag.

# broadcast and emit

Good article explaining [$scope.broadcast/emit and $rootScope.broadcast/emit](https://toddmotto.com/all-about-angulars-emit-broadcast-on-publish-subscribing/)
To correctly broadcast to as less irrelevant receivers as possible,
  think about the relationship between the two controllers you have,
  and use rootScope when it is the only choice.

{'fraction_non_alphanumeric': 0.1206581352833638, 'fraction_numerical': 0.004570383912248629, 'mean_word_length': 4.983606557377049, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5375789', 'n_tokens_mistral': 348, 'n_tokens_neox': 337, 'n_words': 98}