我正在尝试在菜单列表中实现有角度的材质标志。
是否可以将徽标放置在列表项的中央?
官方文件说:“默认情况下,徽章将放置在之后的上方。可以通过定义属性matBadgePosition跟随其后的| below和after | after来更改方向。”
但是我需要排除此|在以下位置选项
或至少可以将整个徽章设置为可见
我已经定义了这样的路线:
const routes: Routes = [
{ path: '', loadChildren: './tabs/tabs.module#TabsPageModule' },
{ path: 'faq', loadChildren: './faq/faq.module#FaqPageModule' },
{ path: 'terms', loadChildren: './terms/terms.module#TermsPageModule' }
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {}
Run Code Online (Sandbox Code Playgroud)
像这样:
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
{
path: '',
redirectTo: '/tabs/(list:list)',
pathMatch: 'full',
},
{
path: 'list',
outlet: 'list',
component: ListPage
},
{
path: 'profile',
outlet: 'profile',
component: ProfilePage,
canActivate: [AuthGuardService]
}
]
},
{
path: '',
redirectTo: …Run Code Online (Sandbox Code Playgroud) 我已经定义了客户实体
@Entity
@Table(name = "customer")
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
private Long id;
@Column(name = "name")
private String name;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Run Code Online (Sandbox Code Playgroud)
和CrudRepository
public interface CustomerRepo extends CrudRepository<Customer, Long> {
}
Run Code Online (Sandbox Code Playgroud)
如果我使用CustomerRepo.findById方法来查找客户
@Autowired
CustomerRepo repo;
Optional<Customer> dbCustomer = repo.findById(id);
Run Code Online (Sandbox Code Playgroud)
我怎样才能得到该客户的名字.我当时不能使用getter.所以我感兴趣的是有没有使用可选的getter的解决方案,或者我需要使用其他方法来通过id查找Customer?
我需要在 tomcat 7 上运行我的 spring boot 2.0 应用程序
我收到这个错误
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:run (default-cli) on project Demo: An exception occurred while running. null: InvocationTargetException: Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more …Run Code Online (Sandbox Code Playgroud)