DIVYANUNU / midterm

0 stars 0 forks source link

21bcad57_ shambhavi #22

Open ShambhaviVijay opened 1 year ago

ShambhaviVijay commented 1 year ago

1.) ISSUE IN ANGULAR: The current implementation of takeUntilDestroyed() operator assumes that the operator is used before the component is destroyed.

2.) The source srcset attribute does no longer require to use a SafeUrl and this was removed in an earlier version of Angular. However, it does not work if a SafeUrl is provided.

3.) FormControl stopped updating after 2 seconds, you can see that when selecting different options of the radio button.

These are some angular issues which needs to be solved.

ShantanuDas8013 commented 1 year ago
  1. I would much prefer using the takeUntil() operator or something similar, to make it look like this:

class myComponent {

constructor( private serviceA: ServiceA, private serviceB: ServiceB, private serviceC: ServiceC) {}

ngOnInit() { const destroy = Observable.fromEvent(???).first(); this.subscriptionA = this.serviceA.subscribe(...).takeUntil(destroy); this.subscriptionB = this.serviceB.subscribe(...).takeUntil(destroy); this.subscriptionC = this.serviceC.subscribe(...).takeUntil(destroy); }

}

  1. Here is a couple of angular approaches :

Use ng-src= instead of src=

The angular docs explain why this works : http://docs.angularjs.org/api/ng.directive:ngSrc

During compilation stage, angular will expand the element to include the correct src= attribute.

This will change the src attrib of the HTML5 audio element, but unfortunately that is NOT enough to make a new song play. You need to prod the audio element into doing something by calling the .play() method.