Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
AngularJs directive for PrismJs
angular.module('Prism', []).
directive('prism', [function() {
return {
restrict: 'A',
link: function ($scope, element, attrs) {
element.ready(function() {

Solved my problem using ui-router with Prism. Really useful for anyone looking to do the same.

vinhlh commented May 29, 2015

You need to add this lines inside link function to make Prism updates when there are a change in your model:

$scope.$watch('{youModelName}', function () {

sunsus commented Sep 16, 2015

Can you update to this Version:

It is better compatible with Plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment