Questions tagged [angular2-styleguide]
18 questions
13
votes
2 answers
Angular 2's Input and Output naming convention, to follow styleguide?
Input and outputs, how to work with them to follow the naming convention of the Angular 2's styleguide?
Before I knew any better I used to have my directive defined like this:
...
inputs: [
'onOutside'
]
...
export class ClickOutsideDirective {
…

Chrillewoodz
- 27,055
- 21
- 92
- 175
4
votes
1 answer
Angular 2 app structure / Core Module and Third Party Libraries
I try to find a good way to structure my Angular 2 app. The Angular 2 styleguide recommends the creation of a core module. If I understand right the goal of the core module is to collect single-use classes and components and keep the root module…

Trafalgar
- 361
- 1
- 4
- 14
4
votes
2 answers
Angular 2 - How do I conditionally add styles to my component?
I have a component with a stylesheet that loads correctly like this:
@Component({
selector: 'open-account',
styleUrls: ['open-account.component.scss'],
templateUrl: './open-account.component.html',
})
I want to conditionally load another…

georgej
- 3,041
- 6
- 24
- 46
4
votes
1 answer
Angular 2: Apply CSS Style with component selector
I'm learning Angular 2 and I wonder if it is possible to apply css style by using the component selector like this:
the component
@Component({
selector: 'app',
styleUrl: './local.css',
templateUrl: './app.html',
})
export class…
2
votes
1 answer
Angular folders/files structure for a simple app (style guide)
I’m studying angular’s style guide and I got some doubts while developing a simple app! The app is to control user’s stock exchange shares. So it’s needed:
a module to authenticate user (signin, signup and reset password)
a module with a component…
1
vote
0 answers
Angular export components's css files into assets
Recently i saw a new angular project (v10) with a curious stucture. Owners said they decided to put all css component files into an asset folder like the example below:
+ src
+ app
- app.component.ts
- app.component.html
-…

Leasye
- 261
- 1
- 8
- 19
1
vote
1 answer
Is there a convention for using Angular brackets binding notation for @Input properties?
Binding a plain string value to a component's @Input property in Angular can be done in either of the two ways:
or:

Johan Hirsch
- 557
- 4
- 21
1
vote
1 answer
Where should Data Services be placed in an Angular App?
I've been questioning myself about the correct place to put the services that talk to API in my Angular app. Initialy, I thought the best position should be in the module of the feature but I'm having doubts about it.
Let's say I have lazy loaded…

Carlos Angarita
- 161
- 3
- 11
1
vote
1 answer
"Cannot find a differ supporting object" when I am using ngstyle
I do have a progress bar
I…
Anjuman Barui
- 11
- 3
0
votes
2 answers
Angular - When should I use child components over passing an @input
My team and I are currently making a component library using Angular (v8.x). We want to establish some house keeping rules and keep our component interfaces intuitive (ie. consistent naming of inputs and usage of patterns).
We have found between us…

Jared Whittington
- 151
- 1
- 9
0
votes
1 answer
Angular feature module vs shared module
I have a question regarding the official Angular styleguide about feature modules.
Let's say i have a feature module person and a feature module cars. Now i want to display a table containing all persons. When clicking a table row the table should…

LorisBachert
- 283
- 1
- 2
- 12
0
votes
1 answer
Is it possible to Inject a CSS Framework for a Module and all its components in Angular2+?
I'm Developing an application that contains 2 Modules, one module for admin layout and another module for user layout. I'm planning to use 2 different frameworks. one for admin and another for user.
one framework that affects the other so i cant…
user6789906
0
votes
2 answers
Angular 5 Core module service undefined in feature module
I'm following the style guide in an Angular 5 project, and I am trying to implement the hardest part of the style guide (core/shared modules). So I want my Core Module to provide a singleton service that is used in all my app. The service is just a…

Mehdi Benmoha
- 3,694
- 3
- 23
- 43
0
votes
1 answer
angularjs directive use controller as vm instead of scope
I am attempting to create a directive. I have been following the john papa opinionated style guide and using controller as vm. unfortunately when I attempt to make a directive I am unsure how to do it without using $scope instead of vm.
(the last…

Bryan Dellinger
- 4,724
- 7
- 33
- 79
0
votes
1 answer
How to import components?
We're developing an Angular Living Styleguide at the moment. We plan to develop components in this styleguide and use them in our Apps.
For the apps, we would also like to use the redux pattern: https://github.com/angular-redux/store
Which I could…

Florian Gössele
- 4,376
- 7
- 25
- 49