How to use bloginfo( ‘template_directory’ ) in array

bloginfo() is using echo, you need a function that returns its value: get_bloginfo().

In this case you could also use just the function get_bloginfo() is using: get_template_directory_uri().