| 
									
										
										
										
											2017-01-26 22:30:42 -08:00
										 |  |  | Naming Conventions in Angular | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  | --- | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-26 22:30:42 -08:00
										 |  |  | In general Angular should follow TypeScript naming conventions. | 
					
						
							| 
									
										
										
										
											2015-08-26 11:48:09 -07:00
										 |  |  | See: https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Classes: | 
					
						
							|  |  |  |   - Example: `Compiler`, `ApplicationMetadata` | 
					
						
							| 
									
										
										
										
											2017-03-12 13:28:56 +01:00
										 |  |  |   - Camel case with first letter uppercase | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  |   - In general prefer single words. (This is so that when appending `Proto` or `Factory` the class  | 
					
						
							|  |  |  |     is still reasonable to work with.) | 
					
						
							| 
									
										
										
										
											2015-08-26 11:48:09 -07:00
										 |  |  |   - Should not end with `Impl` or any other word which describes a specific implementation of an  | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  |     interface. | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  | Interfaces: | 
					
						
							|  |  |  |   - Follow the same rules as Classes  | 
					
						
							| 
									
										
										
										
											2015-08-26 11:48:09 -07:00
										 |  |  |   - Should not have `I` or `Interface` in the name or any other way of identifying it as an interface. | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |    | 
					
						
							|  |  |  | Methods and functions: | 
					
						
							| 
									
										
										
										
											2015-08-28 10:36:58 -07:00
										 |  |  |   - Example: `bootstrap`, `someMethod` | 
					
						
							| 
									
										
										
										
											2017-03-12 13:28:56 +01:00
										 |  |  |   - Should be camel case with first letter lowercase | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-02 12:25:14 +05:30
										 |  |  | Constants: | 
					
						
							| 
									
										
										
										
											2015-08-21 20:13:31 -07:00
										 |  |  |   - Example: `CORE_DIRECTIVES` | 
					
						
							|  |  |  |   - Should be all uppercase with SNAKE_CASE | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 |