Skip to content

feature(generate): provide options to default encapsulation & change detection #2892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Brocco
Copy link
Contributor

@Brocco Brocco commented Oct 26, 2016

Closes #2822

@filipesilva
Copy link
Contributor

The changes themselves lgtm but can you have a look at the failing CI?

@Brocco
Copy link
Contributor Author

Brocco commented Nov 2, 2016

@filipesilva the CI failures were a result of another issue. I rebased and CI is good now.

@Brocco Brocco deleted the comp-defaults-2822 branch December 29, 2016 03:55
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this pull request Feb 9, 2017
@Bielik20
Copy link

Hello, is there documentation or at least an example how to use it?
Also does it work for ng library? Do I need to configure it manually for every lib or just in the main app is ok?

@earshinov
Copy link

@Bielik20 , in case you haven't yet figured it out, here is example usage:

angular.json:

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "frontend": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "prefix": "app",
      "schematics": {
        "@schematics/angular:component": {
>>>       "changeDetection": "OnPush",
          "style": "sass"
        }
      },

Instead of relying on docs, check out the schema file referenced in the beginning of angular.json.

I'll leave the other questions to Angular maintainers. Not experienced enough myself.

@Bielik20
Copy link

Bielik20 commented Mar 2, 2019

Thank you for your help. Ok I misunderstood. I was hoping to set default change detection strategy, not make schematics set one during generation.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to configure default changeDetection and viewEncapsulation used by component generator
5 participants