Last active
November 16, 2017 21:30
-
-
Save johnsardine/f191aa91779abf5ba59559df65e82333 to your computer and use it in GitHub Desktop.
3 - Vue component inside Angular
This file contains 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
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