-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
chore(Conventions): naming standards #196
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import {Component} from 'angular2/core'; | |
import {RouteConfig, Router, ROUTER_DIRECTIVES} from 'angular2/router'; | ||
import {FORM_PROVIDERS} from 'angular2/common'; | ||
|
||
import {Home} from './home/home'; | ||
import {HomeCmp} from './home/home.component'; | ||
|
||
/* | ||
* App Component | ||
|
@@ -36,10 +36,10 @@ import {Home} from './home/home'; | |
` | ||
}) | ||
@RouteConfig([ | ||
{ path: '/', component: Home, name: 'Index' }, | ||
{ path: '/home', component: Home, name: 'Home' } | ||
{ path: '/', component: HomeCmp, name: 'Index' }, | ||
{ path: '/home', component: HomeCmp, name: 'Home' } | ||
]) | ||
export class App { | ||
export class AppCmp { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Certainly is the going standard out there. I just shutter at the thought of naming all components with full suffix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ I like that. At end of day, I like to use what is universally found in the community. It just makes bringing new people into a project easier because they see what they are used to and have seen everywhere else. So I like that personally, but don't want to use it if my project would be the only one using it ;) |
||
name = 'Angular 2 Webpack Starter'; | ||
url = 'https://twitter.com/AngularClass'; | ||
constructor() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import {Component} from 'angular2/core'; | ||
import {Component, OnInit} from 'angular2/core'; | ||
import {FORM_DIRECTIVES} from 'angular2/common'; | ||
import {Http} from 'angular2/http'; | ||
|
||
import {Title} from './providers/title'; | ||
import {XLarge} from './directives/x-large'; | ||
import {Title} from '../../providers/title.provider'; | ||
import {XLarge} from '../../directives/x-large.directive'; | ||
|
||
@Component({ | ||
// The selector is what angular internally uses | ||
// for `document.querySelectorAll(selector)` in our index.html | ||
// for document.querySelectorAll(selector) in our index.html | ||
// where, in this case, selector is the string 'app' | ||
selector: 'home', // <home></home> | ||
// We need to tell Angular's Dependency Injection which providers are in our app. | ||
|
@@ -27,7 +27,7 @@ import {XLarge} from './directives/x-large'; | |
// Every Angular template is first compiled by the browser before Angular runs it's compiler | ||
template: require('./home.html') | ||
}) | ||
export class Home { | ||
export class HomeCmp implements OnInit { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even though using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't include this on purpose |
||
// TypeScript public modifiers | ||
constructor(public title: Title, public http: Http) { | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make a separate pull-request for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!