上一页 1 ··· 177 178 179 180 181 182 183 184 185 ··· 477 下一页
摘要: // course-detail.resolver.ts import {Resolve, ActivatedRouteSnapshot, RouterStateSnapshot} from "@angular/router"; import {Course} from "../shared/mod 阅读全文
posted @ 2020-10-19 23:08 Zhentiw 阅读(146) 评论(0) 推荐(0)
摘要: For example we want to build pipe to sanitizer the url: @Pipe({ name: 'safeUrl' }) export class SafeUrlPipe implements PipeTransform { constructor(pri 阅读全文
posted @ 2020-10-19 22:41 Zhentiw 阅读(166) 评论(0) 推荐(0)
摘要: buildscript { ext.kotlin_version = '1.1-M01' ext.kotlin_gradle_version = '1.1-M01' ext.mokito_kotlin_version = '0.6.0' ext.spek_version = '1.0.89' ext 阅读全文
posted @ 2020-10-18 21:38 Zhentiw 阅读(239) 评论(0) 推荐(0)
摘要: Create a Kotlin class: package com.rsk.kotlin class Meeting(val title: String) { // in Java, you can use getLocation and setLocation var location = "" 阅读全文
posted @ 2020-10-15 21:21 Zhentiw 阅读(129) 评论(0) 推荐(0)
摘要: Create a Java class: package com.rsk.java; import org.jetbrains.annotations.Nullable; public class Person { private String name; private int age; priv 阅读全文
posted @ 2020-10-15 21:04 Zhentiw 阅读(119) 评论(0) 推荐(0)
摘要: package com.rsk interface Signatory { fun sign() } open class Person(val name: String, var age: Int, var isMarried: Boolean = false): Signatory { over 阅读全文
posted @ 2020-10-15 20:48 Zhentiw 阅读(119) 评论(0) 推荐(0)
摘要: If your method is just a single line, it is good to use method expressions: interface Signatory { fun sign() } class Person: Signatory { override fun 阅读全文
posted @ 2020-10-15 18:35 Zhentiw 阅读(92) 评论(0) 推荐(0)
摘要: In Kotlin, there is no static methods, but we can use companion object which works the same as static methods. For example, a class: package com.rsk i 阅读全文
posted @ 2020-10-15 18:30 Zhentiw 阅读(162) 评论(0) 推荐(0)
摘要: First version: fun main(args: Array<String>) { val providers = Providers() val details = providers.getAllProviders() details.forEach { detail -> print 阅读全文
posted @ 2020-10-15 00:08 Zhentiw 阅读(145) 评论(0) 推荐(0)
摘要: fun getAllProviders(fn: (String, String) -> Unit) { // Unit is just like void val allProviders = Providers.getProviders() val it = allProviders.iterat 阅读全文
posted @ 2020-10-14 16:05 Zhentiw 阅读(82) 评论(0) 推荐(0)
上一页 1 ··· 177 178 179 180 181 182 183 184 185 ··· 477 下一页