problem
using jquery on angular 7 not working and not make red to different rows ?
I using jquery on angular 7 but when using this jquery code not working
- import { Component, OnInit } from '@angular/core';
- import * as $ from 'jquery';
- @Component({
- selector: 'app-root',
- templateUrl: './app.component.html',
- styleUrls: ['./app.component.css']
- })
- export class AppComponent implements OnInit {
- title = 'TestIndexSolution';
- constructor() {
- // Called first time before the ngOnInit()
- }
- ngOnInit() {
- $(function () {
- $("#table1").find("tr").each(
- function () {
- var tds = $(this).find("td");
- var value = tds.eq(0).text();
- tds.each(
- function () {
- if (this.innerText != value) {
- tds.css("color", "red");
- return false;
- }
- }
- )
- }
- )
- })
- // Called after the constructor and called after the first ngOnChanges()
- }
- }