Skip to content

Instantly share code, notes, and snippets.

View wellwind's full-sized avatar

Mike Huang wellwind

View GitHub Profile
$(document).ready(function(){
$('.dropdown-menu').parent().on('show.bs.dropdown', function () {
var parentResponsiveTable = $(this).parents('.table-responsive');
var parentTarget = $(parentResponsiveTable).first().hasClass('table-responsive') ? $(parentResponsiveTable) : $(window);
var parentTop = $(parentResponsiveTable).first().hasClass('table-responsive') ? $(parentResponsiveTable).offset().top : 0;
var parentLeft = $(parentResponsiveTable).first().hasClass('table-responsive') ? $(parentResponsiveTable).offset().left : 0;
var dropdownMenu = $(this).children('.dropdown-menu').first();
if (!$(this).hasClass('dropdown') && !$(this).hasClass('dropup')) {
@btroncone
btroncone / rxjs_operators_by_example.md
Last active June 15, 2024 07:17
RxJS 5 Operators By Example
@ArtemGovorov
ArtemGovorov / wallaby.js
Last active June 28, 2017 06:09
Wallaby.js config for ng-cli generated project. The config file needs to be in the project root. Works faster with Electron runner: https://wallabyjs.com/docs/integration/electron.html
module.exports = function (wallaby) {
const compilerOptions = require('./src/tsconfig.json').compilerOptions;
compilerOptions.noEmitOnError = false;
return {
files: [
{pattern: 'node_modules/es6-shim/es6-shim.js', instrument: false},
{pattern: 'node_modules/systemjs/dist/system-polyfills.js', instrument: false},
{pattern: 'node_modules/reflect-metadata/Reflect.js', instrument: false},

如何在Angular動態載入、建立Component

從最末端開始往回講。

ViewContainerRef#createComponent

createComponent<C>(componentFactory: ComponentFactory<C>,
                   index?: number,
                   injector?: Injector,