Skip to content

Instantly share code, notes, and snippets.

@johnsardine
Last active November 16, 2017 21:30
Show Gist options
  • Save johnsardine/f191aa91779abf5ba59559df65e82333 to your computer and use it in GitHub Desktop.
Save johnsardine/f191aa91779abf5ba59559df65e82333 to your computer and use it in GitHub Desktop.
3 - Vue component inside Angular
function SampleAngularController($scope, $element) {
// Create mounting point
const MountingPoint = document.createElement('div');
// Place mounting point in target location
$element.appendChild(MountingPoint);
// Create Vue component
const ComponentVM = new Component({
propsData: {
message: $scope.selectedMessage, // Variable from Angular $scope
},
});
// Mount component to mounting point
ComponentVM.$mount(MountingPoint);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment