Questions tagged [angular2-styleguide]

18 questions
9
votes
1 answer

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 { @Output() onOutside: EventEmitter = new EventEmitter(); } But then I read the styleguide and it…
Chrillewoodz
  • 22,596
  • 18
  • 73
  • 147
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
  • 296
  • 1
  • 2
  • 13
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…
3
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
  • 2,401
  • 4
  • 17
  • 43
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
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
  • 467
  • 2
  • 19
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
  • 143
  • 2
  • 10
1
vote
1 answer

"Cannot find a differ supporting object" when I am using ngstyle

I do have a progress bar
{{ redrated }}%
I…
0
votes
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
  • 330
  • 5
  • 18
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…
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
  • 11
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
  • 2,992
  • 3
  • 18
  • 37
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…
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
  • 3,423
  • 4
  • 21
  • 42
1
2