- All Dom operation
- Use
angular-miniprogram/common
replace@angular/common
, - Use
angular-miniprogram/forms
replace@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
=>bindtap
Prefix 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
createEmbeddedView
only allow instructural directive
,orTemplateRef
createEmbeddedView
need a__templateName
property incontext
object,this property is miniprogram name- this name can be find in a private variable:
(this.templateRef as any)._declarationTContainer.localNames[0]
- only first
template variable
name can be use
ng-template
name can't repeat in one Component, if exist, you can use mulittemplate variable
<ng-template #name1 #name2></ng-template>
#name1
is the alias name, and#name2
is the repeat name- The first name will write in the template file, but all
template variable
can be use in Angular
-
In same project, a Component use other Component
TemlateRef
,template name should follow this format$$mp$$__self$$xxx
same application
orsame library
is same project -
transfer
TemplateRef
to Other library Component, template name should follow this format$$mp$$TemplateScopeName$$xxx
,TemplateScopeName
rule 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