You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -1049,7 +1049,7 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1049
1049
}
1050
1050
```
1051
1051
1052
-
Nota: Ci sono molte opzioni per i nomi delle directive, in particolare dal momento che possono essere usate in ambiti stretti o largi. Scegline uno che sia chiaro e distino che dia senso alla directive e il suo nome del file. Alcuni esempi sono sotto ma vedi la sezione sul dare i nomi per maggiori raccomandazioni.
1052
+
Nota: Ci sono molte opzioni per i nomi delle directive, in particolare dal momento che possono essere usate in ambiti stretti o largi. Scegline uno che sia chiaro e distino che dia senso alla directive e il suo nome del file. Alcuni esempi sono sotto ma vedi la sezione sulla nomenclatura per maggiori raccomandazioni.
1053
1053
1054
1054
### Limiti alla manipolazione del DOM
1055
1055
@@ -1639,29 +1639,29 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1639
1639
1640
1640
**[Torna all'inizio](#table-of-contents)**
1641
1641
1642
-
## Dare i nomi
1642
+
## Nomenclatura
1643
1643
1644
-
### Naming Guidelines
1644
+
### Linee guida per assegnare i nomi
1645
1645
1646
-
- Use consistent names for all components following a pattern that describes the component's feature then (optionally) its type. My recommended pattern is `feature.type.js`. There are 2 names for most assets:
1647
-
* the file name (`avengers.controller.js`)
1648
-
* the registered component name with Angular (`AvengersController`)
1646
+
- Usa nomi consistenti per tutti i componenti seguendo uno schema che descriva le funzionalità dei componenti e poi (a scelta) il suo tipo. Lo schema che consiglio è `feature.type.js`. Ci sono 2 nomi per la maggior parte dei componenti:
1647
+
* il nome del file (`avengers.controller.js`)
1648
+
* il nome del componente registrato con Angular (`AvengersController`)
1649
1649
1650
-
*Perché?*: Naming conventions help provide a consistent way to find content at a glance. Consistency within the project is vital. Consistency with a team is important. Consistency across a company provides tremendous efficiency.
1650
+
*Perché?*: Convezioni sui nomi aiutano a fornire un modo consistente per trovate i contenuti a colpo d'occhio. Essere consisteni in un progetto è vitale. Essere consistenti in un team è importante. Essere consistenti nell'insieme di un'azienda è tremendamente efficiente.
1651
1651
1652
-
*Perché?*: The naming conventions should simply help you find your code faster and make it easier to understand.
1652
+
*Perché?*: Le convezioni sulla nomenclatura dovrebbe semplicemente aiutare a trovare il tuo codice più rapidamente e renderlo più semplice da comprendere.
1653
1653
1654
-
### Feature File Names
1654
+
### Nomi dei file per funzionalità
1655
1655
1656
-
- Use consistent names for all components following a pattern that describes the component's feature then (optionally) its type. My recommended pattern is`feature.type.js`.
1656
+
- Usa nomi consistenti per tutti i componenti seguendo uno schema che descriva le funzionalità dei componenti e poi (a scelta) il suo tipo. Lo schema che consiglio è`feature.type.js`.
1657
1657
1658
-
*Perché?*: Provides a consistent way to quickly identify components.
1658
+
*Perché?*: Fornisce un modo consistente per identificare facilmente i componenti.
1659
1659
1660
-
*Perché?*: Provides pattern matching for any automated tasks.
1660
+
*Perché?*: Fornisce uno schema di corrispondenza per qualsiasi processo di automatizzazione.
1661
1661
1662
1662
```javascript
1663
1663
/**
1664
-
* common options
1664
+
* opzioni compuni
1665
1665
*/
1666
1666
1667
1667
// Controllers
@@ -1677,7 +1677,7 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1677
1677
1678
1678
```javascript
1679
1679
/**
1680
-
* recommended
1680
+
* raccomandato
1681
1681
*/
1682
1682
1683
1683
// controllers
@@ -1706,46 +1706,46 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1706
1706
avenger-profile.directive.spec.js
1707
1707
```
1708
1708
1709
-
Nota: Another common convention is naming controller files without the word `controller`in the file name such as `avengers.js`instead of`avengers.controller.js`. All other conventions still hold using a suffix of the type. Controllers are the most common type of component so this just saves typing and is still easily identifiable. I recommend you choose 1 convention and be consistent for your team.
1709
+
Nota: Un'altra concenzione comune è dare il nome al file del controller senza la parola `controller`nel nome del file come `avengers.js`invece di`avengers.controller.js`. Tutte le altre convenzioni continuano ancora a mantenere il suffisso del tipo. I controller sono i tipi di componenti più comuni perciò questo risparmia digitazione continuando ad essere facilmente identificabili. Consiglio di scegliere 1 convenzione e rimanere consistente nel tuo team.
1710
1710
1711
1711
```javascript
1712
1712
/**
1713
-
* recommended
1713
+
* raccomandato
1714
1714
*/
1715
1715
// Controllers
1716
1716
avengers.js
1717
1717
avengers.spec.js
1718
1718
```
1719
1719
1720
-
### Test File Names
1720
+
### Nomi dei file di test
1721
1721
1722
-
- Name test specifications similar to the component they test with a suffix of `spec`.
1722
+
- Nomina le specifiche dei test in modo similare al componente che testano aggiundendo il suffisso `spec`.
1723
1723
1724
-
*Perché?*: Provides a consistent way to quickly identify components.
1724
+
*Perché?*: Fornisce un modo consistente per identificare facilmente i componenti.
1725
1725
1726
-
*Perché?*: Provides pattern matching for [karma](http://karma-runner.github.io/) or other test runners.
1726
+
*Perché?*: Fornisce uno schema di corrispondeza per [karma](http://karma-runner.github.io/) o altri esecutori di test.
1727
1727
1728
1728
```javascript
1729
1729
/**
1730
-
* recommended
1730
+
* raccomandato
1731
1731
*/
1732
1732
avengers.controller.spec.js
1733
1733
logger.service.spec.js
1734
1734
avengers.routes.spec.js
1735
1735
avenger-profile.directive.spec.js
1736
1736
```
1737
1737
1738
-
### Controller Names
1738
+
### Nomi dei controller
1739
1739
1740
-
- Use consistent names for all controllers named after their feature. Use UpperCamelCase for controllers, as they are constructors.
1740
+
- Usa nomi consistenti per tutti i controller nominandoli come le loro funzionalità. Usa UpperCamelCase per i constroller, dal momento che sono costruttori.
1741
1741
1742
-
*Perché?*: Provides a consistent way to quickly identify and reference controllers.
1742
+
*Perché?*: Fornisce un modo consistente per identificare e referenziare facilmente i controller.
1743
1743
1744
-
*Perché?*: UpperCamelCase is conventional for identifying object that can be instantiated using a constructor.
1744
+
*Perché?*: UpperCamelCase è una convezione per identificare un oggetto che può essere instanziato usando un costruttore.
1745
1745
1746
1746
```javascript
1747
1747
/**
1748
-
* recommended
1748
+
* raccomandato
1749
1749
*/
1750
1750
1751
1751
// avengers.controller.js
@@ -1756,17 +1756,17 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1756
1756
functionHeroAvengers(){ }
1757
1757
```
1758
1758
1759
-
### Controller Name Suffix
1759
+
### Suffisso nel nome di un controller
1760
1760
1761
-
- Append the controller name with the suffix `Controller` or with no suffix. Choose 1, not both.
1761
+
- Aggiungi `Controller` alla fine del nome del controller o no. Segline 1 non entrambi.
1762
1762
1763
-
*Perché?*: The `Controller`suffix is more commonly used and is more explicitly descriptive.
1763
+
*Perché?*: Il suffisso `Controller`è quello più comunemente usato ed è più esplicitamente descrittivo.
1764
1764
1765
-
*Perché?*: Omitting the suffix is more succinct and the controller is often easily identifiable even without the suffix.
1765
+
*Perché?*: L'omissione del sufficco è più coinciso ed il controller è spesso facilmente indentificabile anche senza suffisso.
1766
1766
1767
1767
```javascript
1768
1768
/**
1769
-
* recommended: Option 1
1769
+
* raccomandato: Opzione 1
1770
1770
*/
1771
1771
1772
1772
// avengers.controller.js
@@ -1779,7 +1779,7 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1779
1779
1780
1780
```javascript
1781
1781
/**
1782
-
* recommended: Option 2
1782
+
* raccomandato: Opzione 2
1783
1783
*/
1784
1784
1785
1785
// avengers.controller.js
@@ -1790,15 +1790,15 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1790
1790
functionAvengersController(){ }
1791
1791
```
1792
1792
1793
-
### Factory Names
1793
+
### Nomi delle factory
1794
1794
1795
-
- Use consistent names for all factories named after their feature. Use camel-casing for services and factories.
1795
+
- Usa una nomenclatura consistente per tutte le factory dando i nomi date le loro funzionalità. Usa il camel-case per service e factory.
1796
1796
1797
-
*Perché?*: Provides a consistent way to quickly identify and reference factories.
1797
+
*Perché?*: Fornisce un modo consistente per identificare facilmente e referenziare le factory.
1798
1798
1799
1799
```javascript
1800
1800
/**
1801
-
* recommended
1801
+
* raccomandato
1802
1802
*/
1803
1803
1804
1804
// logger.service.js
@@ -1809,15 +1809,15 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1809
1809
functionlogger(){ }
1810
1810
```
1811
1811
1812
-
### Directive Component Names
1812
+
### Nomi dei componenti directive
1813
1813
1814
-
- Use consistent names for all directives using camel-case. Use a short prefix to describe the area that the directives belong (some example are company prefix or project prefix).
1814
+
- Usa nomi consistenti per putte le directive usando il camel-case. Usa un breve previsso che descriva l'area alla quale la directive appartiene (alcuni esempi sono presiffi relativi all'azienda o al progetto).
1815
1815
1816
-
*Perché?*: Provides a consistent way to quickly identify and reference components.
1816
+
*Perché?*: Fornisce un modo consistente per identificare e referenziare facilmente i componenti.
1817
1817
1818
1818
```javascript
1819
1819
/**
1820
-
* recommended
1820
+
* raccomandato
1821
1821
*/
1822
1822
1823
1823
// avenger.profile.directive.js
@@ -1830,49 +1830,49 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1830
1830
functionxxAvengerProfile(){ }
1831
1831
```
1832
1832
1833
-
### Modules
1833
+
### Moduli
1834
1834
1835
-
- When there are multiple modules, the main module file is named`app.module.js`while other dependent modules are named after what they represent. For example, an admin module is named `admin.module.js`. The respective registered module names would be `app`and`admin`. A single module app might be named`app.js`, omitting the module moniker.
1835
+
- Quando di sono moduli multipli, il modulo principale è nominato come`app.module.js`mentre altri moduli dipendenti prendono i nomi da ciò che rappresentano. Per esempio, un modulo admin è nominato `admin.module.js`. I rispettivi nomi con i quali sono registrati saranno `app`e`admin`. Una app a modulo singolo si chiamerà`app.js`, omettendo l'appellativo module.
1836
1836
1837
-
*Perché?*: An app with 1 module is named`app.js`. It is the app, so why not be super simple.
1837
+
*Perché?*: Una app con 1 modulo si chiama`app.js`. È l'app, quindi perché non estremamente semplice.
1838
1838
1839
-
*Perché?*: Provides consistency for multiple module apps, and for expanding to large applications.
1839
+
*Perché?*: Fornisce consistenza per app che hanno più di un modulo e per poter espandare verso applicazioni a larga scala.
1840
1840
1841
-
*Perché?*: Provides easy way to use task automation to load all module definitions first, then all other angular files (for bundling).
1841
+
*Perché?*: Fornisci un modo semplice al fine di usare processi automatici per caricare prima tutte le definizioni di moduli, successivamente tutti gli altri file di Angular (per il bunndling).
1842
1842
1843
-
### Configuration
1843
+
### Configurazione
1844
1844
1845
-
- Separate configuration for a module into its own file named after the module. A configuration file for the main `app`module is named `app.config.js` (or simply`config.js`). A configuration for a module named `admin.module.js`is named`admin.config.js`.
1845
+
- Separa la configurazione di un modulo nel proprio file chiamato come il modulo. Un file di configurazione per il modulo principale `app`è chiamato `app.config.js` (o semplicemente`config.js`). Un file di configurazione per un modulo chiamato `admin.module.js`sarà`admin.config.js`.
1846
1846
1847
-
*Perché?*: Separates configuration from module definition, components, and active code.
1847
+
*Perché?*: Separa la configurazione dalla definizione, componenti e codice di attivazione del modulo.
1848
1848
1849
-
*Perché?*: Provides a identifiable place to set configuration for a module.
1849
+
*Perché?*: Fornisci una posiszione identificabile per settare la configurazione di un modulo.
1850
1850
1851
-
### Routes
1851
+
### Route
1852
1852
1853
-
- Separate route configuration into its own file. Examples might be`app.route.js`for the main module and`admin.route.js`for the `admin` module. Even in smaller apps I prefer this separation from the rest of the configuration. An alternative is a longer name such as`admin.config.route.js`.
1853
+
- Separa la configurazione delle route nei propri file. Esempi possono essere`app.route.js`per il modulo principale e`admin.route.js`per il modulo `admin`. Anche in piccole app preferisco questa separazione dal resto della configurazione. Una alternativa è un nome più esteso quale`admin.config.route.js`.
1854
1854
1855
1855
**[Torna all'inizio](#table-of-contents)**
1856
1856
1857
1857
## Principio "LIFT" per la struttura dell'applicazione
1858
1858
### LIFT
1859
1859
1860
-
- Structure your app such that you can `L`ocate your code quickly, `I`dentify the code at a glance, keep the `F`lattest structure you can, and`T`ry to stay DRY. The structure should follow these 4 basic guidelines.
1860
+
- Struttura la tua app tale da poter `L`ocate (localizzare) il codice facilmente, `I`dentify (identificare) il codice con uno sguardo, tenere la stuttura più `F`lattest (piatta) che puoi, e`T`ry (provare) a rimanere DRY (Don't Repeat Yourself - Non ripetersi). La struttura dovrebbe seguire queste 4 linee guida basilari.
1861
1861
1862
-
*Why LIFT?*: Provides a consistent structure that scales well, is modular, and makes it easier to increase developer efficiency by finding code quickly. Another way to check your app structure is to ask yourself: How quickly can you open and work in all of the related files for a feature?
1862
+
*Perché LIFT?*: Fornisce una struttura consistente che scala bene, è modulare e rende più semplice aumentare l'efficienza nel trovare facilmente il codice. Un altro modo per verificare la struttura della tua app è chiedeti: Quanto rapidamente puoi aprire e lavorare ad una funzionalità in tutti i file che sono collegati?
1863
1863
1864
-
When I find my structure is not feeling comfortable, I go back and revisit these LIFT guidelines
1864
+
Quando ritengo che la mia struttura non sia confortevole, torno indietro a rivedere le linee guida LIFT
1865
1865
1866
-
1. `L`ocating our code is easy
1867
-
2. `I`dentify code at a glance
1868
-
3. `F`lat structure as long as we can
1869
-
4. `T`ry to stay DRY (Don’t Repeat Yourself) or T-DRY
1866
+
1. `L`ocalizzare il nostro codice con facilità
1867
+
2. `I`dentificare il codice a vista
1868
+
3. `F`lat (pitta) struttura quanto più possibile
1869
+
4. `T`ry (prova) a rimanere DRY (Don’t Repeat Yourself) o T-DRY
1870
1870
1871
-
### Locate
1871
+
### Locate - localizzare
1872
1872
1873
-
- Make locating your code intuitive, simple and fast.
1873
+
- Rendi intuitivo, semplice e facile localizzare il codice.
1874
1874
1875
-
*Perché?*: I find this to be super important for a project. If the team cannot find the files they need to work on quickly, they will not be able to work as efficiently as possible, and the structure needs to change. You may not know the file name or where its related files are, so putting them in the most intuitive locations and near each other saves a ton of time. A descriptive folder structure can help with this.
1875
+
*Perché?*: Ritengo ciò essere estremamente importante per il progetto. Se il team non è in grado di trovare i file di cui necessita rapidamente, non sarà in grado di lavorare il più efficacemente possibile, per cui la struttura necessita un cambiamento. Potresti non sapere il nome del file o dove sono i file a questo correlati quindi posizionarli in nel posto più intuitivo e prossimi gli uni agli altri fa risparmiare un mucchio di tempo. Una descrittiva struttura delle cartelle può essere d'aiuto.
1876
1876
1877
1877
```
1878
1878
/bower_components
@@ -1892,23 +1892,24 @@ Nonostante questa guida speghi i *cosa*, *come* e *perché*, trovo che sia di ai
1892
1892
.bower.json
1893
1893
```
1894
1894
1895
-
### Identify
1895
+
### Identify - identificare
1896
+
1897
+
- Guardando un file dovresti istantaneamente sapere ciò che contiene e cosa rappresenta.
1896
1898
1897
-
- When you look at a file you should instantly know what it contains and represents.
1899
+
*Perché?*: Spendi meno tempo a rintracciare e beccare il codice e diventa più efficente. Se per fare ciò hai bisogno di nomi dei file più lunghi, fallo. Si descrittivo con i nomi dei file e tieni il contenuto del file con esattamente 1 componente. Evita file con più di un controller, diversi service o un misto. Ci sono delle eccezioni alla regola "1 per file" ovvero quando ho una serie di piccole funzionalità correlate l'un l'altra: continuano ad essere facilmente identificabili.
1898
1900
1899
-
*Perché?*: You spend less time hunting and pecking for code, and become more efficient. If this means you want longer file names, then so be it. Be descriptive with file names and keeping the contents of the file to exactly 1 component. Avoid files with multiple controllers, multiple services, or a mixture. There are deviations of the 1 per file rule when I have a set of very small features that are all related to each other, they are still easily identifiable.
1901
+
### Flat - piatto
1900
1902
1901
-
### Flat
1902
1903
1903
-
- Keep a flat folder structure as long as possible. When you get to 7+ files, begin considering separation.
1904
+
- Tieni la struttura delle cartelle piatta il più a lungo possibile. Quando arrivi ad avere 7 o più file, inizia a considerarne una separazione.
1904
1905
1905
-
*Perché?*: Nobody wants to search 7 levels of folders to find a file. Think about menus on web sites … anything deeper than 2 should take serious consideration. In a folder structure there is no hard and fast number rule, but when a folder has 7-10 files, that may be time to create subfolders. Base it on your comfort level. Use a flatter structure until there is an obvious value (to help the rest of LIFT) in creating a new folder.
1906
+
*Perché?*: Nessuno vuole cercare 7 livelli di cartelle per trovare un file. Pensa ai menù di un sito web.. qualunche cosa oltre i 2 livelli dovrebbe esser presa in considerazione. Nella struttura di cartella non c'è una regola con un numero esattamente definito ma quando una cartella contiene 7-10 file, è il momento di creare una sottocartella. Basalo su un livello a te comodo. Usa una struttura più piatta fino a che c'è l'ovvia necessità (praticando il resto dei principi LIFT) di creare una nuova cartella.
1906
1907
1907
-
### T-DRY (Try to Stick to DRY)
1908
+
### T-DRY (Try to Stick to DRY) - Prova a non ripeterti
1908
1909
1909
-
- Be DRY, but don't go nuts and sacrifice readability.
1910
+
- Si DRY, ma non diventare pazzo e sacrificare la leggibilità.
1910
1911
1911
-
*Perché?*: Being DRY is important, but not crucial if it sacrifices the others in LIFT, which is why I call it T-DRY. I don’t want to type session-view.html for a view because, well, it’s obviously a view. If it is not obvious or by convention, then I name it.
1912
+
*Perché?*: Non ripetersi è importante ma non crocuale se sacrifica altri principi LIFT, per questo il principio è Try (provare) DRY. Non voglio digitare session-view.html perché è ovvio essere una view. Se non è ovvio o se per convenzione allora nominala così.
0 commit comments