Skip to content

Commit

Permalink
updated readme for #11 and other minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshgadge committed Sep 21, 2017
1 parent 576bbe5 commit f197d97
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
16 changes: 16 additions & 0 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ Huge discussion threads here:-
[[RFC] Library Support and Boilerplate Comment Thread](https://github.com/angular/angular-cli/issues/6510)


# bootstrap vs. material

We have started with material to customize it for bootstrap wherever it is needed.
This is as opposed to starting with bootstrap and customizing it with with Material wherever needed.

This was done for following reasons :-

* cbp-theme will eventually move to Material
* It is easier to scale down and get rid of bootstrap workarounds once all cbp-theme components are switched to Material
* It means less technical debt for consumer applications given the forward direction towards Material
* For bootstrap we would start with `ngx-bootstrap` vs. `angular material2` and the later is more clean and better library.
* material components are much nicer than bootstrap :)
* cbp-theme forms and some other components are Material themed which will form the bulk of consumer applications.

For detailed discussion refer to [ bootstrap vs. material - issue #11](https://github.com/US-CBP/ngx-cbp-theme/issues/11)

# References

https://github.com/filipesilva/angular-quickstart-lib
Expand Down
18 changes: 12 additions & 6 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,18 @@ ___

* In your `styles.scss` add
```sass
@import '~ngx-cbp-theme/app/ngx-cbp-theme';
@import '~ngx-cbp-theme/ngx-cbp-theme';
```

* Implement required services:


`ngx-cbp-theme` requires implementation of some services provided by the consuming application since those services are beyond the scope of theme.
Ideally these will be provided by other projects hosted in the enterprise.
Hence we need to provide implementation of some of these services (CBPUserService, CBPApplicationsService) before we start our application.

Ideally these will be provided by other projects hosted in the enterprise. Please check common framework team or other Angular teams withing CBP.

However for the sake of this exercise we will provide implementation of some of these services (CBPUserService, CBPApplicationsService) before we start our application.

Since this is just a guide we will create my-user.service (to fake User) and my-applications.service (to fake basic set of applications for header menu).

Lets go ahead and create those using `angular-cli`.
Expand All @@ -76,21 +79,24 @@ ___
ng g s my-applications
```

Ensure `MyUserService` implements `CBPUserService` from `import {CBPUserService, CBPUser} from 'ngx-cbp-theme';`
Make sure we implement all the abstract methods.
Modify `MyUserService` to implement `CBPUserService` from `ngx-cbp-theme`. Make sure we implement all the abstract methods.

Similarly `MyApplicationsService` must implement `CBPApplicationsService` and its methods from `import {CBPApplicationsService} from 'ngx-cbp-theme';`.
Similarly `MyApplicationsService` must implement `CBPApplicationsService` and its methods.


Both class declaration signature looks as below (implementation omitted for brevity).


```typescript
// inside my-user-service.ts
import {CBPUserService, CBPUser} from 'ngx-cbp-theme';
@Injectable()
export class MyUserService implements CBPUserService {
...
}
// inside my-applications-service.ts

import {CBPApplicationsService} from 'ngx-cbp-theme';
@Injectable()
export class MyApplicationsService implements CBPApplicationsService {
...
Expand Down

0 comments on commit f197d97

Please sign in to comment.