What does _ngcontent-c# mean in Angular?

Viewed 59389

I'm learning Angular 2/4 and I see the html tags with the ng generated attributes: _ngcontent-c0, _ngcontent-c1...

What does this c value mean?

2 Answers

you can disable it by adding below import to your component,

import {ViewEncapsulation} from '@angular/core';

import { Component, OnInit } from '@angular/core';
import { ViewEncapsulation } from '@angular/core';

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class DashboardComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}

please note this line :

 encapsulation: ViewEncapsulation.None

make no addition of dynamic attribute from angular

Related