- All Dom operation
- Use
angular-miniprogram/commonreplace@angular/common, - Use
angular-miniprogram/formsreplace@angular/forms - Use
import { HttpClientModule } from 'angular-miniprogram';replaceimport { HttpClientModule } from '@angular/common/http'
- A event with prefix,like
bind,mut-bind,etc,remove:,such asbind:tap=>bindtapPrefix in Angular resolve as
target(window/document/body) - Miniprogram native component need set
schemas:[NO_ERRORS_SCHEMA]inNgModule - if property operation not display on view, need to use
detectChanges - Now, one file only allow one
@Component
createEmbeddedViewonly allow instructural directive,orTemplateRefcreateEmbeddedViewneed a__templateNameproperty incontextobject,this property is miniprogram name- this name can be find in a private variable:
(this.templateRef as any)._declarationTContainer.localNames[0] - only first
template variablename can be use
ng-templatename can't repeat in one Component, if exist, you can use mulittemplate variable<ng-template #name1 #name2></ng-template>#name1is the alias name, and#name2is the repeat name- The first name will write in the template file, but all
template variablecan be use in Angular
-
In same project, a Component use other Component
TemlateRef,template name should follow this format$$mp$$__self$$xxxsame applicationorsame libraryis same project -
transfer
TemplateRefto Other library Component, template name should follow this format$$mp$$TemplateScopeName$$xxx,TemplateScopeNamerule as follow:
import { strings } from '@angular-devkit/core';
//library library name
export function libraryTemplateScopeName(library: string) {
return strings.classify(library.replace(/[@/]/g, ''));
}- for example:
test-library=>TestLibrary,@my/library=>MyLibrary