| import { Component, ViewChild } from '@angular/core'; | |
| import { MyComponent } from './my-component.js'; | |
| const componentAnnotation = new Component({ | |
| selector: "try-view-child-js", | |
| template: `<div><my-component #myComponent></my-component></div>` | |
| }); | |
| export class TryViewChildComponent { | |
| @ViewChild('myComponent') _myComp; // QUESTION: How can I use the ViewChild component which reference my component from template in ES6 class? |
| import { Component, ViewChild} from '@angular/core'; | |
| import { NgbTabset } from '@ng-bootstrap/ng-bootstrap'; | |
| const componentAnnotation = new Component({ | |
| selector: 'your-component', | |
| template: require('./your-component.component.html'), | |
| styles: [require('../your-component.component.scss')], | |
| providers: [NgbTabset], | |
| queries: { | |
| tabs: new ViewChild('tabs') |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
| <!-- | |
| Copyright 2016 Google Inc. All rights reserved. | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and |
| { | |
| "compilerOptions": { | |
| //... | |
| "baseUrl": ".", // This must be specified if "paths" is. | |
| "paths": { | |
| //... | |
| "@uifabric/packages/*": ["node_modules/@uifabric-release/packages/*"] // This mapping is relative to "baseUrl" | |
| } | |
| } | |
| } |
| //... | |
| module.exports = { | |
| //... | |
| moduleNameMapper: { | |
| //... | |
| "@uifabric/package/(.*)$": "@uifabric/package-release/$1" | |
| } | |
| } | |
| //... | |
| module.exports = { | |
| //... | |
| resolve: { | |
| alias: { | |
| //... | |
| "@uifabrics/package": "@uifabrics/package-release", | |
| } | |
| } | |
| } |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j