Skip to content

Commit

Permalink
applying style guide
Browse files Browse the repository at this point in the history
  • Loading branch information
techieshravan committed Mar 14, 2016
1 parent 9be7963 commit f9b04dd
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 27 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component } from 'angular2/core';
import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from 'angular2/router';
import { CreateContactComponent } from '../create-contact/create-contact.component';
import { DisplayContactsComponent } from '../display-contacts/display-contacts';
import { ContactsService } from '../../services/contacts.service';
import { Logger } from '../../services/logger.service';
import { CreateContactComponent } from './contacts/create-contact.component';
import { DisplayContactsComponent } from './contacts/display-contacts.component';
import { ContactsService } from './contacts/contacts.service';
import { Logger } from './logger/logger.service';

@Component({
selector: 'contacts-app',
templateUrl: './src/components/app/app.component.html',
templateUrl: 'app/app.component.html',
directives: [ROUTER_DIRECTIVES],
providers: [ROUTER_PROVIDERS, ContactsService, Logger]
})
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Injectable } from 'angular2/core';
import { ContactsList } from '../mock-contacts';
import { Contact } from '../models/contact';
import { Logger } from './logger.service';
import { ContactsList } from './mock-contacts';
import { Contact } from './contact';
import { Logger } from '../logger/logger.service';

@Injectable()
export class ContactsService {

constructor(private _logger: Logger) { }

getContacts() {
this._logger.log('Getting contacts ...');
return Promise.resolve(ContactsList);
Expand All @@ -24,4 +24,4 @@ export class ContactsService {
ContactsList.push(_contact);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Component } from 'angular2/core';
import { ControlGroup, FormBuilder, Validators } from 'angular2/common';
import { ContactsService } from '../../services/contacts.service';
import { ContactsService } from './contacts.service';

@Component({
selector: 'create-contact',
templateUrl: '/src/components/create-contact/create-contact.html'
templateUrl: 'app/contacts/create-contact.html'
})
export class CreateContactComponent {

private contactForm: ControlGroup;
contactForm: ControlGroup;

constructor(fb: FormBuilder, private _contactsService: ContactsService) {
constructor(private _fb: FormBuilder, private _contactsService: ContactsService) {

this.contactForm = fb.group({
this.contactForm = _fb.group({
name: ['', Validators.required],
address: ['', Validators.required],
city: [''],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { Component, OnInit } from 'angular2/core';
import { Contact } from '../../models/contact';
import { ContactsService } from '../../services/contacts.service';
import { Contact } from './contact';
import { ContactsService } from './contacts.service';

@Component({
selector: 'display-contacts',
templateUrl: 'src/components/display-contacts/display-contacts.html',
styleUrls: ['src/components/display-contacts/display-contacts.css']
templateUrl: 'app/contacts/display-contacts.component.html',
styleUrls: ['app/contacts/display-contacts.component.css']
})
export class DisplayContactsComponent implements OnInit {

contactsList: Contact[];

constructor(private _contactsService: ContactsService) { }

getContacts() {
this._contactsService.getContacts().then(contacts => this.contactsList = contacts);
ngOnInit() {
this._getContacts();
}

ngOnInit() {
this.getContacts();
private _getContacts() {
this._contactsService.getContacts().then(contacts => this.contactsList = contacts);
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///<reference path="../node_modules/angular2/typings/browser.d.ts"/>

import { bootstrap } from 'angular2/platform/browser';
import { AppComponent } from "./components/app/app.component";
import { AppComponent } from "./app.component";

bootstrap(AppComponent);
bootstrap(AppComponent);
4 changes: 2 additions & 2 deletions ContactsManager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}
}
});
System.import('src/bootstrap').then(null, console.error.bind(console));
System.import('app/main').then(null, console.error.bind(console));
</script>

</head>
Expand All @@ -43,4 +43,4 @@
<contacts-app>Loading...</contacts-app>
</body>

</html>
</html>

0 comments on commit f9b04dd

Please sign in to comment.