Last active
April 19, 2018 21:30
-
-
Save jcfranco/fdaf26597b19610d42f082612c9d00ff to your computer and use it in GitHub Desktop.
[IntelliJ IDEA/WebStorm] 4.x ArcGIS API for JavaScript Widget Live Template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set( $VM = $NAME + "ViewModel" ) | |
#set( $FULL_WIDGET_PATH = $PATH_TO_WIDGET_FOLDER + "/" + $NAME ) | |
#set( $MID = $FULL_WIDGET_PATH.replace("/", ".") ) | |
#set( $BASE_CSS_CLASS = $NAME.toLowerCase() ) | |
/// <amd-dependency path="esri/core/tsSupport/declareExtendsHelper" name="__extends" /> | |
/// <amd-dependency path="esri/core/tsSupport/decorateHelper" name="__decorate" /> | |
import { declared, property, subclass } from "esri/core/accessorSupport/decorators"; | |
import Widget = require("esri/widgets/Widget"); | |
import { renderable, tsx } from "esri/widgets/support/widget"; | |
import ${VM} = require("${FULL_WIDGET_PATH}/${VM}"); | |
const CSS: any = { | |
base: "${BASE_CSS_CLASS}" | |
}; | |
@subclass("${MID}") | |
class ${NAME} extends declared(Widget) { | |
//-------------------------------------------------------------------------- | |
// | |
// Lifecycle | |
// | |
//-------------------------------------------------------------------------- | |
constructor(params?: any) { | |
super(); | |
} | |
postInitialize() { | |
} | |
destroy() { | |
} | |
//-------------------------------------------------------------------------- | |
// | |
// Variables | |
// | |
//-------------------------------------------------------------------------- | |
// ... | |
//-------------------------------------------------------------------------- | |
// | |
// Properties | |
// | |
//-------------------------------------------------------------------------- | |
//---------------------------------- | |
// viewModel | |
//---------------------------------- | |
@property({ | |
type: ${VM} | |
}) | |
@renderable() | |
viewModel: ${VM} = new ${VM}(); | |
//-------------------------------------------------------------------------- | |
// | |
// Public Methods | |
// | |
//-------------------------------------------------------------------------- | |
render() { | |
return ( | |
<div class={CSS.base}></div> | |
); | |
} | |
//-------------------------------------------------------------------------- | |
// | |
// Private Methods | |
// | |
//-------------------------------------------------------------------------- | |
// ... | |
} | |
export = ${NAME}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment