Skip to content

Guide · Open source

How to use angular-styleguide: setup, guides and tips

Updated · written with AI from the project's own documentation and checked against our catalogue data

angular-styleguide is a written set of conventions for syntax and for structuring Angular applications, maintained by John Papa. It is documentation, not a tool, so there is nothing to install or run. This guide shows you how to get a local copy, choose the right version of the guide, and use it to agree on shared Angular practices with your team.

angular-styleguidejohnpapa/angular-styleguide · ★ 23.6k · MIT

Quick start

  1. 1Clone the repository. Run git clone https://github.com/johnpapa/angular-styleguide in the folder where you want the files.
  2. 2Identify your Angular version. Check whether your project is Angular 1 or Angular 2 and later.
  3. 3Open the matching guide. Read a1/README.md for Angular 1 or a2/README.md for Angular 2 and later.
  4. 4Read the reasons behind each rule. Focus on why each convention is recommended so you can judge whether it fits your team.
  5. 5Agree on what your team adopts. Discuss the guide with your team and decide which conventions to follow.
  6. 6Propose changes through issues. Open a GitHub issue before suggesting an upstream change, then send a pull request if the change is accepted.

What angular-styleguide is and what it is not

The repository is a style guide for Angular, the web app framework. It explains the conventions the author uses and, as the README puts it, why he chooses them. The guide is based on his development experience, presentations, Pluralsight training courses and work in teams.

The README describes no installable software. If you need a linter, generator or library, this repository will not provide one.

  • Type: written documentation
  • Licence: MIT
  • Prerequisites: none listed in the README

Get a local copy of the repository

The README's only install instruction is to clone the repository with git. Run the command below in the folder where you want the files to live. Once cloned, you can read the guides in your editor or browser.

git clone https://github.com/johnpapa/angular-styleguide

Choose the Angular 1 or Angular 2 guide

The README notes that there are multiple versions of Angular and therefore multiple versions of the guide. Pick the one that matches your codebase before you read further.

The Angular 1 guide lives at a1/README.md in the repository. The Angular 2 guide lives at a2/README.md. The README says to choose your guide appropriately, so do not mix the two without checking which rules apply to your version.

  • Angular 1 codebase: read a1/README.md
  • Angular 2 and later: read a2/README.md, which the README describes as a structured reference

Use the guide to agree on team conventions

The guide is most useful when a team reads it together and decides what to adopt. The README states that it is opinionated and reflects one author's experience, so treat it as a proposal rather than an absolute rule set.

The README's contributing process is a useful model for changing the guide itself or your team's version of it. Open a GitHub issue to discuss a change, then open a pull request that references the issue and explains why the change adds value.

  • Read the reasons behind each rule, not only the rule itself
  • Discuss each convention in a team meeting and record what you adopt
  • Open an issue before proposing a change to the upstream guide
  • Submit a pull request for typo fixes

Understand the licence and reuse terms

The repository is under the MIT licence, which the README summarizes as 'Use this guide. Attributions are appreciated.' The copyright line in the README reads Copyright (c) 2014-2016 John Papa.

The README also says that contributions are made available under the licence of this repository.

What people use it for

  • A team maintaining an Angular 1 codebase uses the a1 guide as a shared reference during code review.
  • A developer building an Angular 2 or later app reads the a2 guide to structure the project.
  • A team writes its own internal conventions, using this guide as a starting point.
  • A developer reads the reasoning behind each choice to learn good Angular practice.

Frequently asked questions

Is angular-styleguide free to use?

Yes. The repository is licensed under the MIT licence, and the README summarizes it as 'Use this guide. Attributions are appreciated.' Check the LICENSE text in the repository for the full terms.

How do I install angular-styleguide?

The README gives one instruction: clone the repository with git clone https://github.com/johnpapa/angular-styleguide. There is no package to install because the project is documentation only.

Which guide should I use for Angular 2 or later?

The README points Angular 2 readers to the a2 guide, located at a2/README.md in the repository. Angular 1 readers should use the a1 guide instead.

Does angular-styleguide include a linter or code checker?

The README does not describe any tool, linter or checker. It is a written style guide. For automated checks, the comparable projects listed for this item include Angular ESLint.

How does this guide compare to the official Angular style guide?

This guide is opinionated and based on one author's experience, and it explains the reasons behind each choice. The official Angular style guide and the Airbnb JavaScript Style Guide are other references you can compare against.

Can I change the guide for my team?

The MIT licence allows reuse. The README asks contributors to open an issue first, then submit a pull request for changes, and it says typo fixes are welcome as pull requests.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Choose angular-styleguide if your team wants shared, reasoned Angular conventions and is comfortable with an opinionated, single-author guide. Pick something else if you need a runnable tool, a linter, or rules that must be followed without discussion, since this repository provides documentation only.

Install options & downloads