Instantly share code, notes, and snippets.

@yoren /functions.php
Last active Mar 13, 2016

Embed
What would you like to do?
Enqueue AngularJS into your theme
<?php
function my_scripts() {
wp_enqueue_script(
'angularjs',
get_stylesheet_directory_uri() . '/bower_components/angular/angular.min.js'
);
wp_enqueue_script(
'angularjs-route',
get_stylesheet_directory_uri() . '/bower_components/angular-route/angular-route.min.js'
);
}
add_action( 'wp_enqueue_scripts', 'my_scripts' );
<!DOCTYPE html>
<html ng-app>
<head>
<title>AngularJS Demo Theme</title>
<?php wp_head(); ?>
</head>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment