refactor(ivy): make styling instructions use the new styling algorithm (#30742)
This commit is the final patch of the ivy styling algorithm refactor. This patch swaps functionality from the old styling mechanism to the new refactored code by changing the instruction code the compiler generates and by pointing the runtime instruction code to the new styling algorithm. PR Close #30742
This commit is contained in:

committed by
Kara Erickson

parent
f14693b9a4
commit
9c954ebc62
@ -478,24 +478,21 @@ describe('compiler compliance', () => {
|
||||
const factory =
|
||||
'factory: function MyComponent_Factory(t) { return new (t || MyComponent)(); }';
|
||||
const template = `
|
||||
const $e0_classBindings$ = ["error"];
|
||||
const $e0_styleBindings$ = ["background-color"];
|
||||
…
|
||||
MyComponent.ngComponentDef = i0.ɵɵdefineComponent({type:MyComponent,selectors:[["my-component"]],
|
||||
factory: function MyComponent_Factory(t){
|
||||
return new (t || MyComponent)();
|
||||
},
|
||||
consts: 1,
|
||||
vars: 0,
|
||||
vars: 2,
|
||||
template: function MyComponent_Template(rf,ctx){
|
||||
if (rf & 1) {
|
||||
$r3$.ɵɵelementStart(0, "div");
|
||||
$r3$.ɵɵstyling($e0_classBindings$, $e0_styleBindings$);
|
||||
$r3$.ɵɵstyling();
|
||||
$r3$.ɵɵelementEnd();
|
||||
}
|
||||
if (rf & 2) {
|
||||
$r3$.ɵɵstyleProp(0, ctx.color);
|
||||
$r3$.ɵɵclassProp(0, ctx.error);
|
||||
$r3$.ɵɵstyleProp("background-color", ctx.color);
|
||||
$r3$.ɵɵclassProp("error", ctx.error);
|
||||
$r3$.ɵɵstylingApply();
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user