Skip to content

Include VERSION.full in initial scaffolding of app #7103

Closed

Description

@fmorriso

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x ] feature request

Versions.

Output from: `ng --version`.
@angular/cli: 1.2.3
node: 8.1.2
os: win32 x64

Repro steps.

ng new example --style=scss

Note The --style is not germaine to the specifics of this feature request. It is only an example.

The log given by the failure.

Desired functionality.

  1. Include VERSION in the default set of imports when creating a new application.
  2. Include VERSION.full in the title property via string interpolation.

Benefits

Immediately shows which version of Angular the app is using when the first ng serve --open is performed.

Mention any other details that might be useful.

Example of desired default app.component.ts

import { Component, VERSION } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = `app using Angular ${VERSION.full}`;
}

Activity

  1. filipesilva commented on Jul 28, 2017

    @filipesilva
    Contributor

    I don't think it's very helpful to have this added. The Angular version doesn't make a difference overall really, and all that text is getting removed in the first 5 minutes of the app being created.

  2. fmorriso commented on Jul 28, 2017

    @fmorriso
    Author

    Agree it will be removed once the app "becomes real". I was hoping to have it included in the "initial scaffolding" to let the "newbies" understand two things:

    1. What version of Angular was actually running the newly scaffolded app.
    2. There is a difference between Angular-CLI and Angular.

    It's no different than all the current set of links that get scafolded into app.component.html, which I hope you'll agree are also one of the "first things to go" once the app "becomes real".

    At least I tried. Thanks for listening.

  3. filipesilva commented on Jul 31, 2017

    @filipesilva
    Contributor

    Completely agree, all the stuff in that app template meant to be deleted ASAP. I just don't think there's anything that is actionable/would change in user behaviour by having the version information. Overall I haven't seen a lot of confusion about CLI and Angular versions myself.

    There's also another factor that I didn't mention: there is an overall effort to de-emphasize versions, and to encourage users to update frequently. It shouldn't matter much to a user whether it's Angular v2 or Angular v4, which is at the source of the It's just Angular you might have heard in some talks. So in that sense highlighting the current version is detrimental to that effort.

  4. fmorriso commented on Jul 31, 2017

    @fmorriso
    Author

    On the one hand, I see your point about encouraging frequent updates, but in the real world, it's best to reduce the potential chaos by limiting updates of "the tools" to 3-4 times per year for a production application.

    Throw in the recent major overhaul of Http (HttpClient in particular) in version 4.3+ and I can almost make the case for knowing which version of Angular is running in order to understand if replacing the way the application deals with HTTP requests with the post-4.3 HttpClient plus Interceptors technique is worth it or not.

    Meanwhile, I'll agree that it's my responsibility to get the desired initial scaffolding to look-and-feel the way I want via a post-ng-new PowerShell script that augments the initial scaffolding of app.component.ts with the display of VERSION.full.

  5. filipesilva commented on Jul 31, 2017

    @filipesilva
    Contributor

    Actually, as far as getting personalized scaffolding goes, we should get #7090 in soon which should allow you to get custom blueprints.

  6. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions